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

How do i kick all players in the server?

Asked by 4 years ago
Edited 4 years ago

i've tried this but it didnt work code:

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

1 answer

Log in to vote
0
Answered by
Zero_Tsou 175
4 years ago
Edited 4 years ago

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

1local Players = game:GetService("Players") ---- game.Players
2for _,Player in pairs (Players:GetPlayers()) do --- looping through all the players
3    Player:Kick("Shutdown") --- kicking them one by one in a for loop
4end
0
Thanks! IEntity_303I 80 — 4y
Ad

Answer this question