Soft shutdown is completely different then what the user is looking for in this post. The user is trying to make everyone get kicked on when a command is run inside of a server.
A soft shutdown on the other hand just puts all players in a temp server and then will re-join the user to a server when the servers start up again. Soft shutdowns are often used so people don’t leave servers so you can keep your player count and so people don’t lose contact to people they are playing with.
Not sure, have worked fine for me (I have only used them on smallish experiences with 3-4 servers max). If it is not reliable to shut down servers then that is somthing I would suggest you contact the dev relations team about.
Now lets add a check to make sure its the game owner & that its the correct command
game:GetService("Players").PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
if msg:lower() == "!shutdown" and player.UserId == game.CreatorId then
end
end)
end)
Now lets add a MessagingService Subscribe Function
local MessagingService = game:GetService("MessagingService")
game:GetService("Players").PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
if msg:lower() == "!shutdown" and player.UserId == game.CreatorId then
MessagingService:PublishAsync("ShutdownServers", "Some message not really needed")
end
end)
end)
Now lets add the shutdown core! this will shutdown all servers.
local MessagingService = game:GetService("MessagingService")
game:GetService("Players").PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
if msg:lower() == "!shutdown" and player.UserId == game.CreatorId then
MessagingService:PublishAsync("ShutdownServers", "Some message not really needed")
end
end)
end)
MessagingService:SubscribeAsync("ShutdownServers", function(message)
for i,v in pairs(game:GetService("Players"):GetPlayers()) do
v:Kick("Server Shutdown")
end
end)