Norhy Posted January 9, 2013 Posted January 9, 2013 Hey guys, i want to make the money that the player has to appear in the Scoreboard under the collum "money". How do i do that?
Castillo Posted January 9, 2013 Posted January 9, 2013 Create a column with the exported function: "scoreboardAddColumn", then make a timer which refreshes "money" element data every some seconds for every player.
MR.S3D Posted January 9, 2013 Posted January 9, 2013 Client Side local starttick, currenttick local player = getLocalPlayer() addEventHandler("onClientRender",getRootElement(), function() if not starttick then starttick = getTickCount() end currenttick = getTickCount() if currenttick - starttick >= 1000 then setElementData(player,"Money",getPlayerMoney( player ) ) ---- set Player Money in the Data starttick = getTickCount() end end ) function updateMoney() for k, v in ipairs(getElementsByType('player')) do local money = getPlayerMoney(v) --- get the money for all player setElementData(v,"Money",money ) --- then put in data end end setTimer(updateMoney, 1000000, 0) Server Side addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function() call(getResourceFromName("scoreboard"),"addScoreboardColumn","Money") --Add it to scoreboard end )
Norhy Posted January 9, 2013 Author Posted January 9, 2013 Thank you very much. Now i can make several collums for other things, thank fo' your example!
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