Protagonist95 Posted July 28, 2016 Share Posted July 28, 2016 Give some examples of inserting elementData by knowing player name(inserted by runcode) Link to comment
MisterQuestions Posted July 28, 2016 Share Posted July 28, 2016 Not really good idea cuz if can't find a player on some name, set element data will give a error. but if you want to continue.. should look like.. setElementData(getPlayerFromName("name"),"data",value) Link to comment
Hale Posted July 28, 2016 Share Posted July 28, 2016 Not really good idea cuz if can't find a player on some name, set element data will give a error.but if you want to continue.. should look like.. setElementData(getPlayerFromName("name"),"data",value) This'll fix the problem: local foundPlayer = getPlayerFromName("name") if (foundPlayer ~= nil) then setElementData(foundPlayer ,"data",value) end Link to comment
MisterQuestions Posted July 28, 2016 Share Posted July 28, 2016 Not really good idea cuz if can't find a player on some name, set element data will give a error.but if you want to continue.. should look like.. setElementData(getPlayerFromName("name"),"data",value) This'll fix the problem: local foundPlayer = getPlayerFromName("name") if (foundPlayer ~= nil) then setElementData(foundPlayer ,"data",value) end Yeah i though about it, but as he said with "runcode" i didn't wanted to make a longer code lol 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