Greenie0101 Posted September 3, 2012 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? New CMG 2.0 Screenshot! http://img560.imageshack.us/img560/4269/cmg2screen.png CMG 2.0 Trailer! Learn to script from simple video tutorials completely free! Click here for forum page Was the scripter for CMG server! Leaving CMG: 100%
TwiX! Posted September 3, 2012 Posted September 3, 2012 show your code you can use setElementData - Working on [php/HTML/Mysql/Lua/Java Scripts/Web Design/3D Modeling]
Greenie0101 Posted September 3, 2012 Author Posted September 3, 2012 function addToScoreBoard() exports [ "scoreboard" ]:scoreboardAddColumn("playerKills", getRootElement(), 70, "Kills", 3) end addEventHandler ( "onResourceStart", getRootElement(), addToScoreBoard ) New CMG 2.0 Screenshot! http://img560.imageshack.us/img560/4269/cmg2screen.png CMG 2.0 Trailer! Learn to script from simple video tutorials completely free! Click here for forum page Was the scripter for CMG server! Leaving CMG: 100%
BorderLine Posted September 3, 2012 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 Actual Nick: [XGN]BorderLine Actual Clan: XLatino Actual Status: Staff, Mod Level 1 (BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline
HunT Posted September 3, 2012 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 @Huntone_
Greenie0101 Posted September 3, 2012 Author 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 New CMG 2.0 Screenshot! http://img560.imageshack.us/img560/4269/cmg2screen.png CMG 2.0 Trailer! Learn to script from simple video tutorials completely free! Click here for forum page Was the scripter for CMG server! Leaving CMG: 100%
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