Jump to content

help with setaccountdata


boro

Recommended Posts

Hi all i make script for set account all 5 sec but this dont work why ? please help..

function updatePlayersKills ( ) 
for index, player in ipairs ( getElementsByType "player" ) do  
local account = getPlayerAccount (player) 
if not (isGuestAccount (account)) then 
setAccountData(account,"Zombie Kills",getElementData(player,"Zombie Kills"))  
end 
end 
end 
setTimer ( updatePlayersKills, 5000, 0 ) 

Link to comment

1- Try this i just output chat box after account data if the chat box work that mean the script work if not that mean the script doesn't work .

2- Maybe the data is wrong?

-- # Server Side! 
function updatePlayersKills ( ) 
    for index, player in ipairs ( getElementsByType ("player") ) do  
        local account = getPlayerAccount (player) --get there account here first 
                if not (isGuestAccount (account)) then 
                        setAccountData(account,"Zombie Kills",getElementData(player,"Zombie Kills"))  
                            outputChatBox("* Account Data true!") 
            end 
        end 
    end 
setTimer ( updatePlayersKills, 5000, 0 ) 
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...