Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local _script, game, require, getmetatable, type, getfenv, wait, pcall, tick, ipairs, unpack, Enum, assert, cos, sin, sort, new, wrap, random, fromRGB, udim2, vec2 = script, game, require, getmetatable, type, getfenv, wait, pcall, tick, ipairs, unpack, Enum, assert, math.cos, math.sin, table.sort, Instance.new, coroutine.wrap, math.random, Color3.fromRGB, UDim2.new, Vector2.new
- getfenv().script = nil
- local GetService, WaitForChild, FindFirstChild = game.GetService, game.WaitForChild, game.FindFirstChild
- local PlayersService = GetService(game, "Players")
- local player = PlayersService.LocalPlayer
- local userId = player.UserId
- local Kick = player.Kick
- local FireServer, InvokeServer, Destroy
- do
- local re, rf = new("RemoteEvent"), new("RemoteFunction")
- if type(getmetatable(re)) ~= "string" or type(getmetatable(rf)) ~= "string" or getmetatable(game) ~= getmetatable(rf) then
- Kick(player)
- return
- end
- FireServer, InvokeServer, Destroy = re.FireServer, rf.InvokeServer, re.Destroy
- if not pcall(function()
- wrap(FireServer)
- end) then
- elseif pcall(function()
- wrap(InvokeServer)
- end) then
- while wait do
- Kick(player)
- end
- end
- end
- local ReplicatedFirst = GetService(game, "ReplicatedFirst")
- local RemoveDefaultLoadingScreen = ReplicatedFirst.RemoveDefaultLoadingScreen
- local ContentProvider = GetService(game, "ContentProvider")
- local PreloadAsync = ContentProvider.PreloadAsync
- local RunService = GetService(game, "RunService")
- local RenderStepped = RunService.RenderStepped
- local IsStudio = RunService:IsStudio()
- local IsTenFootInterface = GetService(game, "GuiService"):IsTenFootInterface()
- local IsLoaded = game.IsLoaded
- local color3lerp = fromRGB().Lerp
- local rejoining = false
- local StarterGui = GetService(game, "StarterGui")
- StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
- StarterGui.ResetPlayerGuiOnSpawn = false
- pcall(StarterGui.SetCore, StarterGui, "TopbarEnabled", false)
- local TEST_LOADING_PERPETUALLY = false
- local forceContinue = false
- local teleportGui, teleRef
- GetService(game, "TeleportService").LocalPlayerArrivedFromTeleport:Connect(function(gui, data)
- teleportGui = gui
- if gui then
- gui.DisplayOrder = 999
- end
- teleRef = data and data.teleRef
- forceContinue = true
- end)
- local screen = new("ScreenGui")
- screen.DisplayOrder = 998
- screen.ResetOnSpawn = false
- screen.IgnoreGuiInset = true
- local bgFrame = new("ImageButton", screen)
- bgFrame.AutoButtonColor = false
- bgFrame.BackgroundColor3 = fromRGB(24, 24, 24)
- bgFrame.BorderSizePixel = 0
- bgFrame.Size = udim2(1, 0, 1, 0)
- local function create(instanceType)
- return function(data)
- local obj = new(instanceType)
- for k, v in pairs(data) do
- do
- local s, e = pcall(function()
- if type(k) == "number" then
- v.Parent = obj
- elseif type(v) == "function" then
- obj[k]:connect(v)
- else
- obj[k] = v
- end
- end)
- if not s then
- error("Create: could not set property " .. k .. " of " .. instanceType .. " (" .. e .. ")", 2)
- end
- end
- end
- return obj
- end
- end
- local function creatingLoadingAssets(gui)
- local loadingIcon = create("ImageLabel")({
- Name = "Disc",
- BackgroundTransparency = 1,
- ImageTransparency = 1,
- Image = "rbxassetid://2984940561",
- SizeConstraint = Enum.SizeConstraint.RelativeYY,
- Size = udim2(0.35, 0, 0.35, 0),
- AnchorPoint = vec2(0.5, 0.5),
- Position = udim2(0.5, 0, 0.5, 0),
- Rotation = 180,
- ZIndex = 11,
- Parent = gui
- })
- local dots = {}
- for i = 1, 3 do
- dots[i] = create("ImageLabel")({
- Name = "Dot" .. i,
- BackgroundTransparency = 1,
- Image = "rbxassetid://940620723",
- ImageTransparency = 1,
- AnchorPoint = vec2(0.5, 0.5),
- Parent = loadingIcon
- })
- end
- return loadingIcon, dots
- end
- local loadingIcon, dots = creatingLoadingAssets(screen)
- wait()
- Destroy(_script)
- _script = nil
- wrap(function()
- pcall(function()
- WaitForChild(game, "Script Context").Name = tick() * random(-tick(), tick())
- end)
- end)()
- local loaded, fadedOut = false, false
- local animateLoading
- wrap(function()
- local previousProgress = 0
- PreloadAsync(ContentProvider, {
- loadingIcon,
- dots[1]
- })
- screen.Parent = WaitForChild(player, "PlayerGui")
- RemoveDefaultLoadingScreen(ReplicatedFirst)
- if teleportGui then
- teleportGui:Destroy()
- end
- local progressIndicator = create("Frame")({
- Name = "Prog",
- Visible = false,
- Parent = screen
- })
- local function Tween(duration, timing, fn)
- local st = tick()
- fn(0)
- while true do
- RenderStepped:wait()
- local et = tick() - st
- if duration <= et then
- fn(1)
- return
- end
- local a = et / duration
- if timing then
- a = timing(et)
- end
- if fn(a) == false then
- return
- end
- end
- end
- local fading = false
- local animating = true
- function animateLoading(doFadeIn, bgToFadeIn, _loadingIcon, _dots)
- local loadingIcon = _loadingIcon or loadingIcon
- local dots = _dots or dots
- if doFadeIn then
- fading = false
- wrap(Tween)(0.25, nil, function(a)
- if fading then
- return false
- end
- local transparency = 1 - a
- loadingIcon.ImageTransparency = transparency
- for i = 1, 3 do
- dots[i].ImageTransparency = transparency
- end
- if bgToFadeIn then
- bgToFadeIn.BackgroundTransparency = transparency
- end
- end)
- else
- loadingIcon.ImageTransparency = 0
- for i = 1, 3 do
- dots[i].ImageTransparency = 0
- end
- end
- animating = true
- local dotColor = fromRGB(73, 155, 255)
- local black = fromRGB(0, 0, 0)
- local radius = 0.3
- local length = 0.35
- local period = 1.5
- local gst = tick() - previousProgress * period
- for i = 0, 2 do
- do
- local angle = 2.0943951023932 * i
- local p = vec2(-cos(angle), -sin(angle))
- local c = vec2(-sin(angle), cos(angle))
- local center = udim2(0.5 - radius * c.X, 0, 0.5 - radius * c.Y, 0)
- local st = gst + 2 * period / 3 * i
- local dot = dots[i + 1]
- wrap(function()
- while animating do
- local et = tick() - st
- local a = et % period / period
- if i == 0 then
- progressIndicator.BackgroundTransparency = a
- end
- local pa = a * 6.2831853071796
- local sn, cs = sin(pa), cos(pa)
- local offset = length * sn * p + 0.065 * (1 - cs) * c
- dot.Position = center + udim2(offset.X, 0, offset.Y, 0)
- local s = 0.055 + 0.025 * cs
- dot.Size = udim2(s, 0, s, 0)
- dot.ImageColor3 = color3lerp(dotColor, black, 0.15 * (1 - cs))
- dot.ZIndex = cs > 0 and 12 or 10
- RenderStepped:Wait()
- end
- end)()
- end
- end
- end
- animateLoading(not teleportGui)
- if not IsStudio then
- wait(2)
- end
- while not loaded do
- wait()
- end
- fading = true
- local t = 1 - loadingIcon.ImageTransparency
- Tween(0.5 * t, nil, function(a)
- local transparency = 1 - t * (1 - a)
- loadingIcon.ImageTransparency = transparency
- for i = 1, 3 do
- dots[i].ImageTransparency = transparency
- end
- end)
- loadingIcon.Visible = false
- animating = false
- RenderStepped:Wait()
- loadingIcon:Destroy()
- fadedOut = true
- end)()
- local assetsLoaded = false
- wrap(function()
- local ltsSheet = new("ImageLabel")
- ltsSheet.Image = "rbxassetid://2498910578"
- local trainSound = new("Sound")
- trainSound.SoundId = "rbxassetid://2565302712"
- local hiSound = new("Sound")
- hiSound.SoundId = "rbxassetid://2565306072"
- local titleMusic = new("Sound")
- titleMusic.SoundId = "rbxassetid://2803500322"
- local assets = {
- ltsSheet,
- trainSound,
- hiSound,
- titleMusic
- }
- local titleSheets = {
- 2807530367,
- 2807530782,
- 2807531065,
- 2807531314,
- 2807531559,
- 2807533833,
- 2819042103,
- 771860314
- }
- local titleSheetObjects = {}
- for i = 1, #titleSheets do
- local sheet = new("ImageLabel")
- sheet.Image = "rbxassetid://" .. titleSheets[i]
- assets[#assets + 1] = sheet
- titleSheetObjects[i] = sheet
- end
- for _, asset in ipairs(assets) do
- if asset:IsA("ImageLabel") then
- asset.Size = UDim2.new(0, 1, 0, 1)
- asset.Position = UDim2.new(0, 15, 0, 26)
- asset.Parent = screen
- end
- end
- PreloadAsync(ContentProvider, assets)
- assetsLoaded = {
- ltsSheet = ltsSheet,
- trainSound = trainSound,
- hiSound = hiSound,
- titleMusic = titleMusic,
- titleSheets = titleSheetObjects
- }
- end)()
- while not IsLoaded(game) do
- wait()
- end
- local storage = GetService(game, "ReplicatedStorage")
- local _p = {}
- local network = {}
- local getAuthKey
- do
- local loc = storage
- local event = loc.POST
- local func = loc.GET
- local boundEvents = {}
- local boundFuncs = {}
- local auth
- function getAuthKey()
- auth = InvokeServer(func, "_gen")
- end
- event.OnClientEvent:Connect(function(fnId, ...)
- if not boundEvents[fnId] then
- return
- end
- boundEvents[fnId](...)
- end)
- function func.OnClientInvoke(fnId, ...)
- if not boundFuncs[fnId] then
- return
- end
- return boundFuncs[fnId](...)
- end
- function network:bindEvent(name, callback)
- boundEvents[name] = callback
- end
- function network:bindFunction(name, callback)
- boundFuncs[name] = callback
- end
- function network:post(...)
- if not auth then
- return
- end
- FireServer(event, auth, ...)
- end
- function network:get(...)
- if not auth then
- return
- end
- return InvokeServer(func, auth, ...)
- end
- _p.Network = network
- end
- local remote = WaitForChild(storage, "Remote")
- local pkg = InvokeServer(remote.Launch, teleRef)
- if not pkg then
- return
- end
- local parent
- for _, ins in ipairs(pkg) do
- local m = ins[2]
- parent = parent or m.Parent
- m.Parent = nil
- end
- if parent then
- Destroy(parent)
- parent = nil
- end
- _p.player = player
- _p.userId = userId
- _p.storage = storage
- _p.debugEnabled = userId == 1084073
- _p.playerRenames = {ShipooI = "Shipool"}
- _p.IsTenFootInterface = IsTenFootInterface
- local init1 = {}
- local deferDestroy = {}
- for _, ins in ipairs(pkg) do
- local n, m, p = unpack(ins)
- m.Name = n
- if p then
- m.Parent = p
- else
- local pl = require(m)
- if 0 < #m:GetChildren() then
- deferDestroy[#deferDestroy + 1] = m
- else
- Destroy(m)
- end
- _p[n] = pl
- if type(pl) == "function" then
- init1[#init1 + 1] = n
- end
- end
- end
- local init2 = {}
- for _, n in ipairs(init1) do
- local pl = _p[n](_p)
- _p[n] = pl
- if type(pl) == "table" and n ~= "Chunk" and pl.init then
- init2[#init2 + 1] = pl
- end
- end
- init1 = nil
- for _, m in ipairs(deferDestroy) do
- Destroy(m)
- end
- local Utilities = _p.Utilities
- _p.Repel = {
- steps = 0,
- kind = 0,
- kinds = {
- {
- id = Utilities.rc4("repel"),
- name = "Repel",
- steps = 100
- },
- {
- id = Utilities.rc4("superrepel"),
- name = "Super Repel",
- steps = 200
- },
- {
- id = Utilities.rc4("maxrepel"),
- name = "Max Repel",
- steps = 250
- }
- }
- }
- getAuthKey()
- _p.context = WaitForChild(storage.Version, "GameContext").Value
- sort(init2, function(a, b)
- return (a.initPriority or 0) > (b.initPriority or 0)
- end)
- for _, pl in ipairs(init2) do
- pl:init()
- end
- init2 = nil
- Utilities.setupDestroyWatch()
- while not assetsLoaded or not Utilities.DefaultFont.loaded do
- wait()
- end
- loaded = not TEST_LOADING_PERPETUALLY
- while not fadedOut do
- wait()
- end
- _p.TeleportScreenUtil = {CreatingLoadingAssets = creatingLoadingAssets, AnimateLoading = animateLoading}
- local boostrap = _p.Bootstrap
- _p.Bootstrap = nil
- boostrap(rejoining, screen, bgFrame, assetsLoaded, forceContinue)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement