Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.54 KB | None | 0 0
  1. 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
  2. getfenv().script = nil
  3. local GetService, WaitForChild, FindFirstChild = game.GetService, game.WaitForChild, game.FindFirstChild
  4. local PlayersService = GetService(game, "Players")
  5. local player = PlayersService.LocalPlayer
  6. local userId = player.UserId
  7. local Kick = player.Kick
  8. local FireServer, InvokeServer, Destroy
  9. do
  10. local re, rf = new("RemoteEvent"), new("RemoteFunction")
  11. if type(getmetatable(re)) ~= "string" or type(getmetatable(rf)) ~= "string" or getmetatable(game) ~= getmetatable(rf) then
  12. Kick(player)
  13. return
  14. end
  15. FireServer, InvokeServer, Destroy = re.FireServer, rf.InvokeServer, re.Destroy
  16. if not pcall(function()
  17. wrap(FireServer)
  18. end) then
  19. if pcall(function()
  20. wrap(InvokeServer)
  21. end) then
  22. while wait do
  23. Kick(player)
  24. end
  25. end
  26. end
  27. end
  28. local ReplicatedFirst = GetService(game, "ReplicatedFirst")
  29. local RemoveDefaultLoadingScreen = ReplicatedFirst.RemoveDefaultLoadingScreen
  30. local ContentProvider = GetService(game, "ContentProvider")
  31. local PreloadAsync = ContentProvider.PreloadAsync
  32. local RunService = GetService(game, "RunService")
  33. local RenderStepped = RunService.RenderStepped
  34. local IsStudio = RunService:IsStudio()
  35. local IsTenFootInterface = GetService(game, "GuiService"):IsTenFootInterface()
  36. local IsLoaded = game.IsLoaded
  37. local color3lerp = fromRGB().Lerp
  38. local rejoining = false
  39. pcall(function()
  40. PlayersService.PlayerRejoining:Connect(function()
  41. rejoining = true
  42. end)
  43. end)
  44. local StarterGui = GetService(game, "StarterGui")
  45. StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
  46. StarterGui.ResetPlayerGuiOnSpawn = false
  47. pcall(StarterGui.SetCore, StarterGui, "TopbarEnabled", false)
  48. local TEST_LOADING_PERPETUALLY = false
  49. local screen = new("ScreenGui")
  50. screen.DisplayOrder = 999
  51. screen.ResetOnSpawn = false
  52. screen.IgnoreGuiInset = true
  53. local bgFrame = new("ImageButton", screen)
  54. bgFrame.AutoButtonColor = false
  55. bgFrame.BackgroundColor3 = fromRGB(24, 24, 24)
  56. bgFrame.BorderSizePixel = 0
  57. bgFrame.Size = udim2(1, 0, 1, 0)
  58. local function create(instanceType)
  59. return function(data)
  60. local obj = new(instanceType)
  61. for k, v in pairs(data) do
  62. do
  63. local s, e = pcall(function()
  64. if type(k) == "number" then
  65. v.Parent = obj
  66. elseif type(v) == "function" then
  67. obj[k]:connect(v)
  68. else
  69. obj[k] = v
  70. end
  71. end)
  72. if not s then
  73. error("Create: could not set property " .. k .. " of " .. instanceType .. " (" .. e .. ")", 2)
  74. end
  75. end
  76. end
  77. return obj
  78. end
  79. end
  80. local loadingIcon = create("ImageLabel")({
  81. BackgroundTransparency = 1,
  82. ImageTransparency = 1,
  83. Image = "rbxassetid://2984940561",
  84. SizeConstraint = Enum.SizeConstraint.RelativeYY,
  85. Size = udim2(0.35, 0, 0.35, 0),
  86. AnchorPoint = vec2(0.5, 0.5),
  87. Position = udim2(0.5, 0, 0.5, 0),
  88. Rotation = 180,
  89. ZIndex = 11,
  90. Parent = screen
  91. })
  92. local dots = {}
  93. for i = 1, 3 do
  94. dots[i] = create("ImageLabel")({
  95. BackgroundTransparency = 1,
  96. Image = "rbxassetid://940620723",
  97. ImageTransparency = 1,
  98. AnchorPoint = vec2(0.5, 0.5),
  99. Parent = loadingIcon
  100. })
  101. end
  102. wait()
  103. Destroy(_script)
  104. _script = nil
  105. wrap(function()
  106. pcall(function()
  107. WaitForChild(game, "Script Context").Name = tick() * random(-tick(), tick())
  108. end)
  109. end)()
  110. local loaded, fadedOut = false, false
  111. wrap(function()
  112. PreloadAsync(ContentProvider, {
  113. loadingIcon,
  114. dots[1]
  115. })
  116. screen.Parent = WaitForChild(player, "PlayerGui")
  117. RemoveDefaultLoadingScreen(ReplicatedFirst)
  118. local Timing = {
  119. easeOutCubic = function(d)
  120. return function(t)
  121. t = t / d - 1
  122. return t ^ 3 + 1
  123. end
  124. end
  125. }
  126. local function Tween(duration, timing, fn)
  127. if type(timing) == "string" then
  128. timing = Timing[timing](duration)
  129. end
  130. local st = tick()
  131. fn(0)
  132. while true do
  133. RenderStepped:wait()
  134. local et = tick() - st
  135. if duration <= et then
  136. fn(1)
  137. return
  138. end
  139. local a = et / duration
  140. if timing then
  141. a = timing(et)
  142. end
  143. if fn(a) == false then
  144. end
  145. return
  146. end
  147. end
  148. local fading = false
  149. wrap(Tween)(0.25, nil, function(a)
  150. if fading then
  151. return false
  152. end
  153. local transparency = 1 - a
  154. loadingIcon.ImageTransparency = transparency
  155. for i = 1, 3 do
  156. dots[i].ImageTransparency = transparency
  157. end
  158. end)
  159. local animating = true
  160. local dotColor = fromRGB(73, 155, 255)
  161. local black = fromRGB(0, 0, 0)
  162. local radius = 0.3
  163. local length = 0.35
  164. local period = 1.5
  165. local gst = tick()
  166. for i = 0, 2 do
  167. do
  168. local angle = 2.0943951023932 * i
  169. local p = vec2(-cos(angle), -sin(angle))
  170. local c = vec2(-sin(angle), cos(angle))
  171. local center = udim2(0.5 - radius * c.X, 0, 0.5 - radius * c.Y, 0)
  172. local st = gst + 2 * period / 3 * i
  173. local dot = dots[i + 1]
  174. wrap(function()
  175. while animating do
  176. local et = tick() - st
  177. local a = et % period / period
  178. local pa = a * 6.2831853071796
  179. local sn, cs = sin(pa), cos(pa)
  180. local offset = length * sn * p + 0.065 * (1 - cs) * c
  181. dot.Position = center + udim2(offset.X, 0, offset.Y, 0)
  182. local s = 0.055 + 0.025 * cs
  183. dot.Size = udim2(s, 0, s, 0)
  184. dot.ImageColor3 = color3lerp(dotColor, black, 0.15 * (1 - cs))
  185. dot.ZIndex = cs > 0 and 12 or 10
  186. RenderStepped:Wait()
  187. end
  188. end)()
  189. end
  190. end
  191. if not IsStudio then
  192. wait(2)
  193. end
  194. while not loaded do
  195. wait()
  196. end
  197. fading = true
  198. local t = 1 - loadingIcon.ImageTransparency
  199. Tween(0.5 * t, nil, function(a)
  200. local transparency = 1 - t * (1 - a)
  201. loadingIcon.ImageTransparency = transparency
  202. for i = 1, 3 do
  203. dots[i].ImageTransparency = transparency
  204. end
  205. end)
  206. loadingIcon.Visible = false
  207. animating = false
  208. RenderStepped:Wait()
  209. loadingIcon:Destroy()
  210. fadedOut = true
  211. end)()
  212. local assetsLoaded = false
  213. wrap(function()
  214. local ltsSheet = new("ImageLabel")
  215. ltsSheet.Image = "rbxassetid://2498910578"
  216. local trainSound = new("Sound")
  217. trainSound.SoundId = "rbxassetid://2565302712"
  218. local hiSound = new("Sound")
  219. hiSound.SoundId = "rbxassetid://2565306072"
  220. local titleMusic = new("Sound")
  221. titleMusic.SoundId = "rbxassetid://2803500322"
  222. local assets = {
  223. ltsSheet,
  224. trainSound,
  225. hiSound,
  226. titleMusic
  227. }
  228. local titleSheets = {
  229. 2807530367,
  230. 2807530782,
  231. 2807531065,
  232. 2807531314,
  233. 2807531559,
  234. 2807533833,
  235. 2819042103,
  236. 771860314
  237. }
  238. local titleSheetObjects = {}
  239. for i = 1, #titleSheets do
  240. local sheet = new("ImageLabel")
  241. sheet.Image = "rbxassetid://" .. titleSheets[i]
  242. assets[#assets + 1] = sheet
  243. titleSheetObjects[i] = sheet
  244. end
  245. for _, asset in ipairs(assets) do
  246. if asset:IsA("ImageLabel") then
  247. asset.Size = UDim2.new(0, 1, 0, 1)
  248. asset.Position = UDim2.new(0, 15, 0, 26)
  249. asset.Parent = screen
  250. end
  251. end
  252. PreloadAsync(ContentProvider, assets)
  253. assetsLoaded = {
  254. ltsSheet = ltsSheet,
  255. trainSound = trainSound,
  256. hiSound = hiSound,
  257. titleMusic = titleMusic,
  258. titleSheets = titleSheetObjects
  259. }
  260. end)()
  261. while not IsLoaded(game) do
  262. wait()
  263. end
  264. local storage = GetService(game, "ReplicatedStorage")
  265. local _p = {}
  266. local network = {}
  267. local getAuthKey
  268. do
  269. local loc = storage
  270. local event = loc.POST
  271. local func = loc.GET
  272. local boundEvents = {}
  273. local boundFuncs = {}
  274. local auth
  275. function getAuthKey()
  276. auth = InvokeServer(func, "_gen")
  277. end
  278. event.OnClientEvent:Connect(function(fnId, ...)
  279. if not boundEvents[fnId] then
  280. return
  281. end
  282. boundEvents[fnId](...)
  283. end)
  284. function func.OnClientInvoke(fnId, ...)
  285. if not boundFuncs[fnId] then
  286. return
  287. end
  288. return boundFuncs[fnId](...)
  289. end
  290. function network:bindEvent(name, callback)
  291. boundEvents[name] = callback
  292. end
  293. function network:bindFunction(name, callback)
  294. boundFuncs[name] = callback
  295. end
  296. function network:post(...)
  297. if not auth then
  298. return
  299. end
  300. FireServer(event, auth, ...)
  301. end
  302. function network:get(...)
  303. if not auth then
  304. return
  305. end
  306. return InvokeServer(func, auth, ...)
  307. end
  308. _p.Network = network
  309. end
  310. local remote = WaitForChild(storage, "Remote")
  311. local pkg = InvokeServer(remote.Launch)
  312. if not pkg then
  313. return
  314. end
  315. local parent
  316. for _, ins in ipairs(pkg) do
  317. local m = ins[2]
  318. parent = parent or m.Parent
  319. m.Parent = nil
  320. end
  321. if parent then
  322. Destroy(parent)
  323. parent = nil
  324. end
  325. _p.player = player
  326. _p.userId = userId
  327. _p.storage = storage
  328. _p.debugEnabled = userId == 1084073
  329. _p.playerRenames = {ShipooI = "Shipool"}
  330. _p.IsTenFootInterface = IsTenFootInterface
  331. local init1 = {}
  332. local deferDestroy = {}
  333. for _, ins in ipairs(pkg) do
  334. local n, m, p = unpack(ins)
  335. m.Name = n
  336. if p then
  337. m.Parent = p
  338. else
  339. local pl = require(m)
  340. if 0 < #m:GetChildren() then
  341. deferDestroy[#deferDestroy + 1] = m
  342. else
  343. Destroy(m)
  344. end
  345. _p[n] = pl
  346. if type(pl) == "function" then
  347. init1[#init1 + 1] = n
  348. end
  349. end
  350. end
  351. local init2 = {}
  352. for _, n in ipairs(init1) do
  353. local pl = _p[n](_p)
  354. _p[n] = pl
  355. if type(pl) == "table" and n ~= "Chunk" and pl.init then
  356. init2[#init2 + 1] = pl
  357. end
  358. end
  359. init1 = nil
  360. for _, m in ipairs(deferDestroy) do
  361. Destroy(m)
  362. end
  363. local Utilities = _p.Utilities
  364. _p.Repel = {
  365. steps = 0,
  366. kind = 0,
  367. kinds = {
  368. {
  369. id = Utilities.rc4("repel"),
  370. name = "Repel",
  371. steps = 100
  372. },
  373. {
  374. id = Utilities.rc4("superrepel"),
  375. name = "Super Repel",
  376. steps = 200
  377. },
  378. {
  379. id = Utilities.rc4("maxrepel"),
  380. name = "Max Repel",
  381. steps = 250
  382. }
  383. }
  384. }
  385. getAuthKey()
  386. _p.context = WaitForChild(storage.Version, "GameContext").Value
  387. sort(init2, function(a, b)
  388. return (a.initPriority or 0) > (b.initPriority or 0)
  389. end)
  390. for _, pl in ipairs(init2) do
  391. pl:init()
  392. end
  393. init2 = nil
  394. Utilities.setupDestroyWatch()
  395. while not assetsLoaded or not Utilities.DefaultFont.loaded do
  396. wait()
  397. end
  398. loaded = not TEST_LOADING_PERPETUALLY
  399. while not fadedOut do
  400. wait()
  401. end
  402. local boostrap = _p.Bootstrap
  403. _p.Bootstrap = nil
  404. boostrap(rejoining, screen, bgFrame, assetsLoaded, false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement