TheIceman1 Posted March 16, 2013 Posted March 16, 2013 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 )
Baseplate Posted March 16, 2013 Posted March 16, 2013 setElementData(source, "Clan", "None") should be setElementData(players, "Clan", "None")
PaiN^ Posted March 16, 2013 Posted March 16, 2013 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 ..!
TAPL Posted March 16, 2013 Posted March 16, 2013 The third argument of setElementData is variable not string lol?
iPrestege Posted March 16, 2013 Posted March 16, 2013 The third argument of setElementData is variable not string lol? bool .
PaiN^ Posted March 16, 2013 Posted March 16, 2013 Working,thanks! You're welcome . The third argument of setElementData is variable not string lol? bool . It ses var in wiki bool setElementData ( element theElement, string key, var value [, bool synchronize = true ] )
TAPL Posted March 16, 2013 Posted March 16, 2013 This setElementData(players, "Clan", "None") And this local none = "None" setElementData(players, "Clan", none) both of them are same, there no diffrent.
PaiN^ Posted March 16, 2013 Posted March 16, 2013 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:
TAPL Posted March 16, 2013 Posted March 16, 2013 Who say it didn't? Have you tried it before say it didn't work?
PaiN^ Posted March 16, 2013 Posted March 16, 2013 Who say it didn't?Have you tried it before say it didn't work? setElementData(source, "Clan", "None") should be setElementData(players, "Clan", "None") Nothing happens.
iPrestege Posted March 16, 2013 Posted March 16, 2013 (edited) Do anyone have? I have 2 Do you want one? Edited March 16, 2013 by Guest
Renkon Posted March 16, 2013 Posted March 16, 2013 for index, players in ipairs ( getElementsByType "player" ) do What the LULZ? how can that work,
TAPL Posted March 16, 2013 Posted March 16, 2013 for index, players in ipairs ( getElementsByType "player" ) do What the LULZ? how can that work, if i am not wrong, this way work too.
Renkon Posted March 16, 2013 Posted March 16, 2013 What the heck? So if that works then outputChatBox "Hello world" Would that work? Never knew something like that
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