Baseplate Posted December 7, 2015 Posted December 7, 2015 function getOnlineMems() local memsTable = {} for k, v in pairs (getElementsByType("player")) do if (isPlayerMem(v)) then table.insert(memsTable, v) return memsTable end end end Now pretty much, whenever I try to get the table it returns with 1 members only and doesn't return all the online members.
Dealman Posted December 7, 2015 Posted December 7, 2015 Well, you're returning the table with every execution, instead return the table after the for loop has finished.
Baseplate Posted December 7, 2015 Author Posted December 7, 2015 Well, you're returning the table with every execution, instead return the table after the for loop has finished. Thank fuck, thanks mate works like a charm mate!
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