TheIceman1 Posted March 16, 2013 Share 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 ) Link to comment
Baseplate Posted March 16, 2013 Share Posted March 16, 2013 setElementData(source, "Clan", "None") should be setElementData(players, "Clan", "None") Link to comment
PaiN^ Posted March 16, 2013 Share 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 ..! Link to comment
TAPL Posted March 16, 2013 Share Posted March 16, 2013 The third argument of setElementData is variable not string lol? Link to comment
iPrestege Posted March 16, 2013 Share Posted March 16, 2013 The third argument of setElementData is variable not string lol? bool . Link to comment
PaiN^ Posted March 16, 2013 Share 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 ] ) Link to comment
TAPL Posted March 16, 2013 Share 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. Link to comment
PaiN^ Posted March 16, 2013 Share 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: Link to comment
TAPL Posted March 16, 2013 Share Posted March 16, 2013 Who say it didn't? Have you tried it before say it didn't work? Link to comment
PaiN^ Posted March 16, 2013 Share 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. Link to comment
iPrestege Posted March 16, 2013 Share Posted March 16, 2013 (edited) Do anyone have? I have 2 Do you want one? Edited March 16, 2013 by Guest Link to comment
Renkon Posted March 16, 2013 Share Posted March 16, 2013 for index, players in ipairs ( getElementsByType "player" ) do What the LULZ? how can that work, Link to comment
TAPL Posted March 16, 2013 Share 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. Link to comment
Renkon Posted March 16, 2013 Share Posted March 16, 2013 What the heck? So if that works then outputChatBox "Hello world" Would that work? Never knew something like that 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