Hello, I am looking to make a system that teleports users to a different game when the game comes out with an update. Similar to the kind of system “Arsenal” has.
When a server shuts down, game:BindToClose() can be used to run some lines at the last moment. This can yield for up to 30 seconds before the game shuts down regardless of whether you’ve saved data/teleported people and whatnot.
This is useful for saving player data last minute and for, in this instance, soft shutdowns.
You could do something like:
Create a new place through Asset Manager,
Name it whatever but make sure you have the ID.
Add a UI into that place that says ‘Updating game…’ or whatnot.
game:BindToClose(function()
--> teleport players to a reserved server
end)
then after like, 5 seconds, have the place they’re taken to teleport them back.
Hi,
I see you are trying to create an Auto Updating System for your servers.
If this is your first time creating an auto update system or a server shutdown system,
try: Soft Shutdown (Client Based Teleport) - Roblox by TheNexusAvenger.
The UI is customizable so you can add a new background image and make it like Arsenal’s server restart system.
I was trying to create my own because I thought it was quite interesting. I have run into a problem though. When getting the update time it doesn’t change after the game has been updated. Here is my code.
local placeIdStart = "https://games.rprxy.xyz/v1/games?universeIds=" -- gets info
local universeIdStart = "https://api.rprxy.xyz/universes/get-universe-containing-place?placeid=" -- converts place id to universe id
local placeId = tostring(game.PlaceId) -- the place id
local lastupdate = ""
universeId = "" -- place holder univers id
pcall(function()
universeId = tostring(httpService:JSONDecode(httpService:GetAsync(universeIdStart .. placeId)).UniverseId) -- finds the universe id
local webiste = httpService:GetAsync(placeIdStart .. universeId) --finds website with info
lastupdate = httpService:JSONDecode(webiste).data[1].updated
print(universeId)
end)
local repeatTime = 1 -- variables
pcall(function()
while true do
wait(repeatTime) -- wait
local webiste = httpService:GetAsync(placeIdStart .. universeId) --finds website with info
local convertToTable = httpService:JSONDecode(webiste).data[1].updated --finds last update date.
print(convertToTable) -- prints
if convertToTable ~= lastupdate then
print("game updated!")
lastupdate = convertToTable
end
end
end)