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

How do i kick all players in the server?

i've tried this but it didnt work code:

local players = game.Players:GetPlayers()
players:Kick("Shutdown") 

1 answer

✓ Accepted answer

You need to loop through all the players in a for loop

local Players = game:GetService("Players") ---- game.Players
for _,Player in pairs (Players:GetPlayers()) do --- looping through all the players
	Player:Kick("Shutdown") --- kicking them one by one in a for loop
end

1 comment

0

Thanks!

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