Jump to content

[SOLVED] bad argument in isObjectInACLGroup


#RooTs

Recommended Posts

hello guys, because it is giving bad argument in "isObjectInACLGroup"

already I looked at several examples in WiFi, but could not solve

local acls = { "Moderator", "S-Moderadora", "SuperModerator", "Admin","Console","Sub.dono" } 
  
addEventHandler( "onResourceStart", resourceRoot, 
    function() 
        for _,v in pairs(getElementsByType("player")) do 
            bindKey(v, "2", "down", toggleGodMode) 
        end 
    end 
) 
  
addEventHandler( "onPlayerJoin", root, 
    function() 
        bindKey(source, "2", "down", toggleGodMode) 
    end 
) 
  
function toggleGodMode(thePlayer) 
    local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
    for _, k in pairs ( acls ) do 
        if isObjectInACLGroup ("user."..accName, aclGetGroup(k)) then 
            if getElementData(thePlayer,"invincible") then 
                setElementData(thePlayer,"invincible",false) 
                 
            else 
                setElementData(thePlayer,"invincible",true) 
                 
            end 
            break 
        end 
    end 
end 

Edited by Guest
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...