Try this

this is untested and does require Discord_perms

replace folder_name with the folder you have this script located in.

replace staff_team with the discord role you wish to use

this is for discord, using it for ace perms would be the same as using isAdmin

client.lua

local godmode = false
local isAdmin = false
 
Citizen.CreateThread(function()
    TriggerServerEvent("folder_name.getIsAllowedAdmin")
end)

RegisterNetEvent("folder_name.returnIsAllowedAdmin")
AddEventHandler("folder_name.returnIsAllowedAdmin", function(IsAllowedAdmin)
    allowedToUse2 = IsAllowedAdmin
end)

RegisterCommand('godmode', function(source, args, rawCommand, user)

	if admin then
		god = not god
		if god then
		godmode = true
		  TriggerEvent("chatMessage", "[Goverment]", {255, 0, 0}, "Godmode Activiated")
		else
			godmode = false
		  TriggerEvent("chatMessage", "[Goverment]", {255, 0, 0}, "Godmode Deactivated")
		end
		else
		 TriggerEvent("chatMessage", "[Goverment]", {255, 0, 0}, "You're not staff")
		end
	
end)

server.lua

RegisterServerEvent("folder_name.getIsAllowedAdmin")
AddEventHandler("folder_name.getIsAllowedAdmin", function()
    local src = source
    if exports.discord_perms:IsRolePresent(src, "Staff Team") then
        TriggerClientEvent("folder_name.returnIsAllowedAdmin", src, true)
    else
        TriggerClientEvent("folder_name.returnIsAllowedAdmin", src, false)
    end
end)