Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How could i kick all players in a for loop, but ignore a specific player?

I'm trying to replicate the code below, but ignore a specific player. (IGNORE KICKING A SPECIFIC PLAYER)

local Players = game:GetService("Players")


for _, player in pairs(Players:GetChildren()) do
	
	player:Kick("No Reason")
	
	
end

1 answer

✓ Accepted answer

Easy.

local Players = game:service("Players")
while wait() do
for _, player in pairs(Players:players()) do
if player.UserId == 0 or player.Name == "" then
else
player:Kick("No Reason")
end
end
end

This discussion is preserved as it was. New answers, comments, and votes are closed.