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

Any way to actual shutdown a server via script?

Asked by
cabbler 1942 Moderation Voter
6 years ago

game.Shutdown is locked. and if you simply kick each player even OnPlayerAdded the server won't shutdown. It will wait for players.

1 answer

Log in to vote
0
Answered by 5 years ago

Let´s make it a GUI button for this example. And the path would be game.StarterGui.ShutdownGUI.ShutdownButton.ClickScript.

So, the ClickScript has this in it:

script.Parent.MouseButton1Down:Connect(function(Shutdown)
game.workspace:ClearAllChildren()
game.Players:ClearAllChildren()

ROBLOX Studio should automatically add any ends that are needed.

Ad

Answer this question