Jump to content

scoreboard column data


xTravax

Recommended Posts

hi i am new with scoreboard functions and i barely know them,

i looked into wiki ,im using dxscoreboard resource which i renamed to scoreboard

and im using this code

exports.scoreboard:scoreboardAddColumn( "Player Level" ) 
function dxScore() 
setTimer(function() 
local gData = getElementData(source,"LV") 
setElementData ( source, "Player Level", gData ) 
end,1500,0) 
end 
addEventHandler("onPlayerLogin",root,dxScore) 

this makes column on scoreboard with value 0,but i can't change it

pls help

Link to comment

You have to send the source with the timer, because setTimer doesn't have a source.

exports.scoreboard:scoreboardAddColumn( "Player Level" ) 
function dxScore() 
setTimer(function(tPlayer) 
local gData = getElementData(tPlayer,"LV") 
setElementData ( tPlayer, "Player Level", gData ) 
end,1500,0, source) 
end 
addEventHandler("onPlayerLogin",root,dxScore) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...