Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Having Issues with for i,v in pairs?

Asked by
DevWork 80
9 years ago

When I try to add more than one User to the code it some reason ignores the if v.Name ~= part out. If anyone could help it would be much appreciated.

while wait() do
for i,v in pairs(game.Players:GetChildren()) do
if v.Name ~= "Player" or v.Name ~= "Player2" or v.Name ~= "Player3" then
v:Destroy()
end
end
end

Thanks in advance :)

0
Get rid of the brackets around each string when you're checking the name. Also, you can use v:Kick(), it's much more efficient than removing the player. Spongocardo 1991 — 9y
0
I'll try that out now, thanks. DevWork 80 — 9y
0
Not working, still doing the same thing. :? DevWork 80 — 9y

Answer this question