I wanted to make my game server shutdown or kick all players when one of the player leave the server, how can I do that and let all the players see a text with reason?
game.Players.PlayerRemoving:Connect(function(plr) for i,v in pairs(game.Players:GetPlayers()) do v:Kick("You have been kicked because one of the player left the game") end)
I am noob with script and that's all what I tried with my game :/

6 comments
my game is a 3 player cooperation game,if one of the player leave the game when the others are playing,they will be stuck in the game,and the new player who join the game cannot follow their part,then the players can't play the game as well.
however,thanks a lot for answering.
and it's worked, thanks again!
That's fair, but I think if you lose a player, you should tell the players that a player left and wait for another player so it isnt as much of an annoyance.
but the players can't get to the part without the help of other players,and there are checkpoints in the game so the players can't get back to the place where they start.
How about restarting the game and putting them in some sort of in game lobby until someone else joins