Stevenn Posted May 12, 2012 Share Posted May 12, 2012 Hello. I need some help. If I want to increase someones element data, like different levels how can I do that? function lol () setElementData ( source, "Rank", +1 ) end or something? Link to comment
Castillo Posted May 12, 2012 Share Posted May 12, 2012 function lol ( ) setElementData ( source, "Rank", tonumber ( getElementData ( source, "Rank" ) ) or 0 + 1 ) end Link to comment
Stevenn Posted May 12, 2012 Author Share Posted May 12, 2012 thank you, can i use setElementData without adding a column on scoreboard? Link to comment
Booo Posted May 12, 2012 Share Posted May 12, 2012 thank you, can i use setElementData without adding a column on scoreboard? exports.scoreboard:addScoreboardColumn('Rank') function lol ( ) if getElementData ( source, "Rank" ) then setElementData ( source, "Rank", tonumber ( getElementData ( source, "Rank" ) ) + 1 ) else setElementData ( source, "Rank",0 ) end end Link to comment
Stevenn Posted May 12, 2012 Author Share Posted May 12, 2012 I clearly said WITHOUT, please stop post hunting ! Link to comment
Castillo Posted May 12, 2012 Share Posted May 12, 2012 Of course you can, the scoreboard is just a resource that uses the element data. Link to comment
Booo Posted May 12, 2012 Share Posted May 12, 2012 I clearly said WITHOUT, please stop post hunting ! np I just wanted to help you Link to comment
Stevenn Posted May 12, 2012 Author Share Posted May 12, 2012 guiSetText ( rankLabel, "Rank: " ..getElementData (localPlayer, "Rank") ) doesn't work.. Link to comment
Castillo Posted May 12, 2012 Share Posted May 12, 2012 Why not? does it output something on debugscript? Link to comment
Stevenn Posted May 12, 2012 Author Share Posted May 12, 2012 I had a typo, fixed now. But if I want it to update my level every now and then, how would I do that? I know its with a timer, but I'm not so god with timers! Link to comment
Kenix Posted May 12, 2012 Share Posted May 12, 2012 onElementDataChange ? onClientElementDataChange ? 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