Jump to content

Life regen [Solved]


DRW

Recommended Posts

addEventHandler ("onPlayerLogin", root, function() 
    local account = getPlayerAccount (source) 
    if not isGuestAccount(account) then 
    local accName = getAccountName (account) 
        if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
        setTimer (function () 
        setElementHealth (source, getElementHealth (source)+10) 
        end, 2000, 0) 
        end 
        end 
         
        end) 
         
         
         

it says getElementHealth expected element at argument 1, got nil. What's happening?

Edited by Guest
Link to comment

try this it should work

addEventHandler ("onPlayerLogin", root,  
    function(prev,cur) 
        if isObjectInACLGroup ("user."..getAccountName(cur), aclGetGroup ( "Admin" ) ) then 
        setTimer (function(player) 
            setElementHealth (player, getElementHealth (player)+10) 
        end, 2000, 0,source) 
    end 
end) 

Link to comment
try this it should work
addEventHandler ("onPlayerLogin", root,  
    function(prev,cur) 
        if isObjectInACLGroup ("user."..getAccountName(cur), aclGetGroup ( "Admin" ) ) then 
        setTimer (function(player) 
            setElementHealth (player, getElementHealth (player)+10) 
        end, 2000, 0,source) 
    end 
end) 

Thanks!

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...