So I have this fragment of a script here. For some reason, table.remove isn't functioning.
The output says: "bad argument #2 to 'remove' (number expected, got string)
playersnotplaying = {}
for i,v in pairs(game.Players:GetChildren()) do
table.insert(playersnotplaying, v.Name)
end
randomplayer = playersnotplaying[math.random(1, #playersnotplaying)]
for i,v in pairs(playersnotplaying) do
table.remove(playersnotplaying, randomplayer)
end
I don't understand why this isn't functioning properly.

2 comments
Thanks ,it too made me understand what I was doing wrong, LEARNING IS KEY :P
Oh, thanks. I understand it now. :)