Very messed, lemme help.
function toggleGodMode(thePlayer)
local account = getPlayerAccount(thePlayer)
if not account or isGuestAccount(account) then return end
local accountName = getAccountName(account)
if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Moderator" ) ) then
setElementData(thePlayer,"invincible",not getElementData(thePlayer,"invincible"))
if getElementData(thePlayer,"invincible") then outputChatBox("God Mode is now Disabled.",thePlayer,0,255,0)
else outputChatBox("God Mode is now Enabled.",thePlayer,0,255,0) end
end
addCommandHandler("godmode",toggleGodMode)
addCommandHandler("god",toggleGodMode)