audi868 Posted August 10, 2011 Share Posted August 10, 2011 Hi, I am making a kills/deaths save script on accountData and I want to retrieve the kills/deaths on login but it is not working in proper way, i.e it does not loads the kills/deaths on login here is my code, root = getRootElement() addEventHandler("onPlayerLogin",root,function(account) local kills = getAccountData(account,"kills") local deaths = getAccountData(account,"deaths") if not (deaths and kills) then return end setElementData(source,"kills",kills) setElementData(source,"deaths",deaths) outputDebugString("Player score set") end ) Link to comment
JR10 Posted August 10, 2011 Share Posted August 10, 2011 root = getRootElement() addEventHandler("onPlayerLogin",root,function(_, account) local kills = getAccountData(account,"kills") local deaths = getAccountData(account,"deaths") if not (deaths and kills) then return end setElementData(source,"kills",kills) setElementData(source,"deaths",deaths) outputDebugString("Player score set") end ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now