Greenie0101 Posted September 3, 2012 Share Posted September 3, 2012 How do i add kills and playtime to the scoreboard? I have an account data for kills so i think i can use that number for the kills but how do i get it into the scoreboard? Link to comment
TwiX! Posted September 3, 2012 Share Posted September 3, 2012 show your code you can use setElementData Link to comment
Greenie0101 Posted September 3, 2012 Author Share Posted September 3, 2012 function addToScoreBoard() exports [ "scoreboard" ]:scoreboardAddColumn("playerKills", getRootElement(), 70, "Kills", 3) end addEventHandler ( "onResourceStart", getRootElement(), addToScoreBoard ) Link to comment
BorderLine Posted September 3, 2012 Share Posted September 3, 2012 addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function() call(getResourceFromName("scoreboard"),"addScoreboardColumn","Kills", getRootElement(), 3, 70) end ) and as twix say, use setElementData to put in kills column Link to comment
HunT Posted September 3, 2012 Share Posted September 3, 2012 Server Side : exports.scoreboard:addScoreboardColumn('Kills') -- Done function killScore () -- The Function local sourceAccount = getPlayerAccount ( source ) -- Get The Account local playerKills = tonumber ( getAccountData ( sourceAccount , "Kills" ) ) -- if the table name is Kills (maybe is kills, not Kills) if playerKills == false then -- guest Account setElementData ( source, "Kills", "0" ) -- set 0 to guest accounts else setElementData ( source, "Kills", playerKills ) -- Done end end addEventHandler ( "onPlayerSpawn", getRootElement(), killScore ) addEventHandler ( "onPlayerLogin", getRootElement(), killScore ) -- u can add other Event Link to comment
Greenie0101 Posted September 3, 2012 Author Share Posted September 3, 2012 Ok im at school but ill be home in 6 hours. Ill try it then. Thanks for the help works thanks alot all 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