Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How do i kick all players in the server?

Asked by 7 days ago
Edited 7 days ago

i've tried this but it didnt work code:

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

1 answer

Log in to vote
0
Answered by 7 days ago
Edited 7 days ago

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
0
Thanks! IEntity_303I 2 — 7d
Ad

Answer this question