Hello, fellow developers,
I am MobileGamer1253. And I came across a problem while developing my game, and it is kinda frustrating!
What do you want to achieve? Create a soft shutdown system to not lose players
What is the issue? I tried Merely’s Soft Shutdown Script and even tried to change it, but whenever the game shuts down for an update, This message appears after seeing the “Rebooting” message from shutdown script.
Video Evidence(Sorry for lag): Evidence.wmv (1.1 MB)
What solutions have you tried so far? I looked multiple times through the DevForum and checked all tutorials I could find on YouTube too.But not a single one of them worked or even put me on the right track.
If anyone has any APIs that could help me or have modifications that can be added to Merely’s Script, I would appreciate hearing your solutions on this thread or DMs.
You should just be teleporting people to another place on BindToClose, (after saving their data). This other places waits 30 seconds, then teleports players back.
I tried instead of Merely’s Shutdown Script this using game:BindToClose():
game:BindToClose(function(
local Teleport = game:GetService("TeleportService")
local RS = Teleport:ReserveServer(game.PlaceId)
for _, player in pairs(game.Players:GetPlayers()) do
Teleport:TeleportToPrivateServer(game.PlaceId, RS, {player})
wait()
end
end)
--When player joins reserved server
game.Players.PlayerAdded:Connect(function(player)
if game.PrivateServerId ~= "" and game.PrivateServerOwnerId == 0 then
local Teleport = game:GetService("TeleportService")
Teleport:Teleport(game.PlaceId, player)
end
end)
This is the code I used instead of Merely’s Soft Shutdown(removing code of message of “Rebooting”).
However, this too didn’t work…
Your system wouldn’t work. First of all you are teleporting to the same place, also why to Private server? Just teleport them. I recommend using :TeleportAsync() tho.
This special place needs to be separated, and then you should wait 30 seconds in the second place, and then teleport them back.