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

How to make the system kick all players?

Asked by
ANE_bot 17
5 years ago

In my game, Alfa Labs 2, After a meltdown I want all players to be kicked and be shown a reason like the lab has been destroyed or something. How?

1
For every player call Kick. Kick is a function in Player objects. https://developer.roblox.com/api-reference/function/Player/Kick pidgey 548 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
for x,d in pairs(game.Players:GetChildren()) do
    d:Kick("booted")
end

Or simply:

game.Players:ClearAllChildren()
0
GetPlayers() is better now it exists Arkrei 389 — 5y
0
dont use GetChildren() use children() WikiBaseHealthFinder 40 — 5y
0
oh no User#6546 35 — 5y
Ad

Answer this question