I'm making a murder mystery game and getting everyone that's not the murder of sheriff will be an innocent but I wanna get everyone from the table that's the innocent but I tried some scripts and it didn't work, Can anyone help me?
Here's the code thats the problem:
local innocent = playersAlive:GetChildren()
I would recommend using "i,v in pairs"
for i, v in pairs(innocent)do --whatever you need to do end
This will loop through the table and do what is inside the for loop for every member of the table. For instance this will print the name of every innocent player:
for i, v in pairs(innocent)do print(v.Name) -- v refers to the member of the table (i refers to the index or what loop you are currently on.) end
I'm not very good with words, but I hope this helped. ;)