I need help i am trying to write a soft shutdown that makes a menu visible and animates it
is based off of this one
code:
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
local function OpenRebootScreen(plr)
--L1 pos/size: 0.487, 0, 0.475, 0 / 0.974, 0, 0.029, 0
--L2 pos/size: 0.476, 0, 0.516, 0 / 0.953, 0, 0.029, 0
--slc text size: 0.324, 0, 0.148, 0
--main text: All SLC servers are restarting for update(s). Please standby.
local RebootScreen = plr:WaitForChild("PlayerGui", 2).RebootScreen
local ModuleService = require(game:GetService("ReplicatedStorage"):WaitForChild("ModuleService", 2))
local cont = RebootScreen.Container
local L1 = RebootScreen.Container.line_1
local L2 = RebootScreen.Container.line_2
local slc = RebootScreen.Container.slc_text
local main = RebootScreen.Container.main_text
local Tween = function(...)
return script.Tween.Tween(...)
end
cont.Visible = true
Tween(cont, 1, "Exponential", "Out", {Position = UDim2.new(0.5, 0, 0.5, 0)})
Tween(L1, 2, "Exponential", "Out", {Position = UDim2.new(0.487, 0, 0.475, 0)})
task.wait(1)
Tween(L2, 2, "Exponential", "Out", {Position = UDim2.new(0.476, 0, 0.516, 0)})
task.wait(2)
Tween(slc, 2, "Exponential", "Out", {Size = UDim2.new(0.324, 0, 0.148, 0)})
ModuleService:write(main, "All SLC servers are restarting for update(s). Please standby.")
end
if (game.VIPServerId ~= "" and game.VIPServerOwnerId == 0) then
-- this is a reserved server without a VIP server owner
local waitTime = 5
Players.PlayerAdded:connect(function(player)
OpenRebootScreen(player)
task.wait(waitTime)
waitTime = waitTime / 2
TeleportService:Teleport(game.PlaceId, player)
end)
for _,player in pairs(Players:GetPlayers()) do
OpenRebootScreen(player)
TeleportService:Teleport(game.PlaceId, player)
task.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
task.wait(1)
local reservedServerCode = TeleportService:ReserveServer(game.PlaceId)
for _,player in pairs(Players:GetPlayers()) do
OpenRebootScreen(player)
task.wait(4)
TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, { player })
end
Players.PlayerAdded:connect(function(player)
OpenRebootScreen(player)
task.wait(4)
TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, { player })
end)
while (#Players:GetPlayers() > 0) do
task.wait(1)
end
end)
end
it doesnt work at all , it doesnt show the menu or tp me to a reserved place or show errors.Can someone help ?