Jump to content

Scoreboard


TheIceman1

Recommended Posts

Why this dont set "None" on scoreboard if i dont have clan?No errors.

exports [ "scoreboard" ]:addScoreboardColumn ( "Clan", 3 ) 
  
function updatePlayerClan ( ) 
    for index, players in ipairs ( getElementsByType "player" ) do 
    if ( getElementData ( players, "clan" ) == "false" ) then 
        setElementData(source, "Clan", "None") 
    else 
        setElementData ( players, "Clan", getElementData ( players, "clan" ) ) 
    end 
    end 
end 
setTimer ( updatePlayerClan, 2500, 0 ) 

Link to comment

The third argument of setElementData is variable not string, Try :

exports [ "scoreboard" ]:addScoreboardColumn ( "Clan", 3 ) 
local none = "None" 
  
function updatePlayerClan ( ) 
    for index, players in ipairs ( getElementsByType "player" ) do 
    if ( getElementData ( players, "clan" ) == "false" ) then 
        setElementData(players, "Clan", none) 
    else 
        setElementData ( players, "Clan", getElementData ( players, "clan" ) ) 
    end 
    end 
end 
setTimer ( updatePlayerClan, 2500, 0 ) 

Not sure though ..!

Link to comment
This
setElementData(players, "Clan", "None") 

And this

local none = "None" 
  
setElementData(players, "Clan", none) 

both of them are same, there no diffrent.

But it worked by this :

local none = "None" 
  
setElementData(players, "Clan", none) 

And didn't by this :

setElementData(players, "Clan", "None") 

s:

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...