Shutdown only kicks the 1 player

  1. What do you want to achieve? Keep it simple and clear!

I want the game to kick everybody from the server when an admin clicks the shutdown button.

  1. What is the issue? Include screenshots / videos if possible!

The issue is that only the admin gets kicked and not all the players.

Code

local frame = script.Parent.Parent.ShutdownFrame
local button = script.Parent

button.MouseButton1Click:Connect(function()
	game.Players.LocalPlayer.PlayerGui.AdminPanel.Frame.ShutdownFrame.Visible = true
end)

frame.Shutdown.MouseButton1Click:connect(function()
	for _, players in pairs(game.Players:GetPlayers()) do
		game.ReplicatedStorage.ShutdownGUI:FireServer()
		wait(10)
		players:Kick(frame.Reason.Text)
	end
end)

Local script inside shutdown button.

It’s because you’re trying to kick them from the client, you should to use a remote event to kick them from the server instead.