GUI tween not working

So I have been trying to use @Merely’s Soft Reboot script, and it works perfectly except that the messages just looked old and not very pleasing. So I tried to edit it to tween in a GUI instead of the message thing. The issues is that it does not tween in after I shut down the game, it only appears in the loading server( where you get teleported to so that the servers shut down). I have no idea why it does not work. Any help is appreciated.

local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
GUI = game.StarterGui.SoftRebootGUI
if (game.VIPServerId ~= "" and game.VIPServerOwnerId == 0) then
   GUI.Frame:TweenPosition(UDim2.new(0,0,-0.1,0), "InOut", "Sine", 0.5)
   
   local waitTime = 5

   Players.PlayerAdded:connect(function(player)
   	wait(waitTime)
   	waitTime = waitTime / 2
   	TeleportService:Teleport(game.PlaceId, player)
   end)
   
   for _,player in pairs(Players:GetPlayers()) do
   	TeleportService:Teleport(game.PlaceId, player)
   	wait(waitTime)
   	waitTime = waitTime / 2
   end
else
   game:BindToClose(function()
   	if (#Players:GetPlayers() == 0) then
   		return
   	end
   	
   	if (game:GetService("RunService"):IsStudio()) then
   		return
   	end
   		GUI.Frame:TweenPosition(UDim2.new(0,0,-0.1,0), "InOut", "Sine", 0.5)
   
   	wait(2)
   	local reservedServerCode = TeleportService:ReserveServer(game.PlaceId)
   	
   	for _,player in pairs(Players:GetPlayers()) do
   		TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, { player })
   	end
   	Players.PlayerAdded:connect(function(player)
   		TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, { player })
   	end)
   	while (#Players:GetPlayers() > 0) do
   		wait(1)
   	end
   end)
end

I’m confused as to what you’re trying to do here. If the game is shutdown why do you want to move the GUI?

What happens it that it detects when the game is shut down from the website, then it places everyone to reserved servers after a couple seconds, and then teleports them back to the new and updated servers. I want it to have a GUI tween in so that it gives a bit of a warning, instead of randomly teleporting everyone.

Well it looks like you’re teleporting them before waiting. Swap it around and see if that does the trick.

try this:

local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
local GUI = game.StarterGui.SoftRebootGUI
if (game.VIPServerId ~= "" and game.VIPServerOwnerId == 0) then
   GUI.Frame:TweenPosition(UDim2.new(0,0,-0.1,0), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, 0.5)
   
   local waitTime = 5

   Players.PlayerAdded:connect(function(player)
   	wait(waitTime)
   	waitTime = waitTime / 2
   	TeleportService:Teleport(game.PlaceId, player)
   end)
   
   for _,player in pairs(Players:GetPlayers()) do
   	TeleportService:Teleport(game.PlaceId, player)
   	wait(waitTime)
   	waitTime = waitTime / 2
   end
else
   game:BindToClose(function()
   	if (#Players:GetPlayers() == 0) then
   		return
   	end
   	
   	if (game:GetService("RunService"):IsStudio()) then
   		return
   	end
   		GUI.Frame:TweenPosition(UDim2.new(0,0,-0.1,0), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, 0.5)
   
   	wait(2)
   	local reservedServerCode = TeleportService:ReserveServer(game.PlaceId)
   	
   	for _,player in pairs(Players:GetPlayers()) do
   		TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, { player })
   	end
   	Players.PlayerAdded:connect(function(player)
   		TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, { player })
   	end)
   	while (#Players:GetPlayers() > 0) do
   		wait(1)
   	end
   end)
end

Oof. Neither one fixed it.
(30 chars)

UhOhBigBrain, you didn’t do Enum.EasingDirection.InOut, Enum.Easing(Something).Elastic (Or whatever tween you want)

It still tweens in inside the reserved server though, so I don’t think it’s an issue with the tween itself. I don’t know why it doesn’t work in the normal server before being teleported.

Oh. Well apart from that, I really don’t know.

can you link the place so i am can check?

Solved it. I had put it in the wrong place.

1 Like