Anubhav Posted September 26, 2014 Share Posted September 26, 2014 addCommandHandler("duty", function(p) for k,v in ipairs(players) do local acc = getPlayerAccount(p) This is only piece of code. Error: Expect element at argument one, got nil Link to comment
Moderators IIYAMA Posted September 26, 2014 Moderators Share Posted September 26, 2014 did you checked p before the loop? To be honest it is a strange error, but please check your variables first. Link to comment
Anubhav Posted September 26, 2014 Author Share Posted September 26, 2014 did you checked p before the loop?To be honest it is a strange error, but please check your variables first. Its realy strange dude, I don't know whats wrong. What do you mean by p was checked? Link to comment
Anubhav Posted September 26, 2014 Author Share Posted September 26, 2014 Problem solved, the problem was: I was replacing the script in other folder LOL Link to comment
TAPL Posted September 26, 2014 Share Posted September 26, 2014 It would be better to get the account outside the loop. Link to comment
Anubhav Posted September 26, 2014 Author Share Posted September 26, 2014 It would be better to get the account outside the loop. Arnold told me to increase the performance by that and I did it. Anyways thanks to you too. Link to comment
xXMADEXx Posted September 26, 2014 Share Posted September 26, 2014 It would be better to get the account outside the loop. Arnold told me to increase the performance by that and I did it. Anyways thanks to you too. He was wrong then, it is better performance to get the account outside the loop. addCommandHandler("duty", function(p) local acc = getPlayerAccount(p) for k,v in ipairs(players) do -- loop code end -- rest of your code end ) Link to comment
Anubhav Posted September 26, 2014 Author Share Posted September 26, 2014 Arnold told me to increase the performance by that and I did it. Anyways thanks to you too. He was wrong then, it is better performance to get the account outside the loop. addCommandHandler("duty", function(p) local acc = getPlayerAccount(p) for k,v in ipairs(players) do -- loop code end -- rest of your code end ) Damn you misunderstood that. I was telling TAPL is correct, he told me to take it of loop anyways. Link to comment
#DRAGON!FIRE Posted September 26, 2014 Share Posted September 26, 2014 just put the line out loop . Link to comment
justn Posted September 27, 2014 Share Posted September 27, 2014 just put the line out loop . You just copied what everyone said. 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