I have a piece of code that looks like this:
for _,v in pairs(game.Players:GetChildren()) do v:Kick("Server shutdown") end
But when it runs, it only says "You have been kicked from the game", without the "Server shutdown"! What is going on here?
When you do an enhanced loop you are accessing there model. In this case we want to get the element/folder. We do this by game.Players.LocalPlayer
. That local player part is the player folder but since we don't add any conditions or arguments to this it runs it on all players. So the solution is to put a local script in the starter gui and then do game.Players.LocalPlayer:Kick("Your message")