Advertisement
LilPastebin12334

Untitled

Jul 23rd, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.08 KB | None | 0 0
  1. --SynapseX Decompiler
  2.  
  3. local TutorialService = require(game.ReplicatedStorage.LocalModules.TutorialService)
  4. local player = game.Players.LocalPlayer
  5. local mouse = player:GetMouse()
  6. local prev, link
  7. local playerSpeed, playerTime = game.Workspace.Remotes.getHackSpeed:InvokeServer(player)
  8. local once = 0
  9. local messages = {
  10. "Articulating Protocols",
  11. "Modulating Circuits",
  12. "Rewiring Sensors",
  13. "Provoking Firewall",
  14. "Decrypting PSK",
  15. "Backtracking Rabithole",
  16. "Spraying UBIK",
  17. "Consulting the I Ching",
  18. "Polarizing Capasitors",
  19. "Playing Song 1994",
  20. "Regulating Paths",
  21. "Circumventing Defences",
  22. "Shutting Down Interface",
  23. "Collecting Meta Data",
  24. "Populating Cache",
  25. "Ejecting Cores",
  26. "Concocting Concoctions"
  27. }
  28. function watch(prev)
  29. while prev and player:DistanceFromCharacter(prev.Position) < 50 do
  30. wait(1)
  31. end
  32. if prev and prev:FindFirstChild("SelectionBox") then
  33. prev:FindFirstChild("SelectionBox"):Destroy()
  34. end
  35. return nil
  36. end
  37. function promptHack(targ, prev, once)
  38. TutorialService.transitionStage(nil, "UseTheHackdar", "HackAVault")
  39. local sb = script.SelectionBox:Clone()
  40. sb.Parent = targ
  41. sb.Adornee = targ
  42. if prev and prev:FindFirstChild("SelectionBox") then
  43. prev:FindFirstChild("SelectionBox"):Destroy()
  44. prev = nil
  45. end
  46. local hack = script.HackGui:Clone()
  47. local enLevel = 0
  48. if targ.Parent:FindFirstChild("Encryption") then
  49. enLevel = targ.Parent.Encryption.Value
  50. else
  51. hack.Prompt.Encryption.Visible = false
  52. hack.Success.Time2.Text = "Open for 30s"
  53. end
  54. local estTime = 10
  55. if enLevel ~= 0 then
  56. if playerTime and enLevel then
  57. estTime = playerTime * enLevel
  58. end
  59. else
  60. estTime = math.ceil(playerTime / 3)
  61. end
  62. hack.Prompt.Time.Text = "Estimated Time: " .. estTime .. "s"
  63. hack.Prompt.Encryption.Text = "Encryption Level " .. enLevel
  64. hack.Prompt.Encryption.TextColor3 = Color3.new(enLevel / 5, 1 - enLevel / 5, 0)
  65. if targ.Parent.Parent:FindFirstChild("Toggle") then
  66. hack.Prompt.Thing.Text = "Portal"
  67. else
  68. hack.Prompt.Thing.Text = targ.Parent.ObjName.Value
  69. end
  70. hack.Parent = player.PlayerGui
  71. hack.Prompt.Hack.MouseButton1Click:connect(function()
  72. local vaultComplex = targ:FindFirstAncestor("Vault")
  73. if vaultComplex ~= nil then
  74. vaultComplex = vaultComplex.Parent
  75. else
  76. vaultComplex = targ:FindFirstAncestor("Scripted").Parent
  77. end
  78. if not TutorialService.skipped() or vaultComplex ~= nil and vaultComplex.Owner.Value ~= player.Name then
  79. hack.Prompt:Destroy()
  80. hack.Active.Visible = true
  81. hack.Active.Time.Text = "Estimated Time Left: " .. estTime .. "s"
  82. local errors = 0
  83. for i = 1, estTime * 10 do
  84. wait(0.1)
  85. if hack and hack:FindFirstChild("Active") then
  86. local passOrfail = math.random(10 * playerSpeed) == 1
  87. hack.Active.Time.Text = "Estimated Time Left: " .. estTime - i * 0.1 .. "s"
  88. if not passOrfail then
  89. hack.Active.LoadBar.Size = UDim2.new(i / (estTime * 10), 0, 0.5, 0)
  90. else
  91. errors = errors + 1
  92. i = i - 1
  93. hack.Active.Errors.Text = "Errors: " .. errors
  94. end
  95. if i % 20 == 0 then
  96. hack.Active.Message.Text = messages[math.random(#messages)]
  97. end
  98. if i % 10 == 0 and player:DistanceFromCharacter(targ.Position) >= 50 then
  99. hack:Destroy()
  100. end
  101. end
  102. end
  103. local owner
  104. if targ.Parent.Parent:FindFirstChild("Owner") then
  105. owner = targ.Parent.Parent:FindFirstChild("Owner").Value
  106. elseif targ.Parent.Parent.Parent:FindFirstChild("Owner") then
  107. owner = targ.Parent.Parent.Parent:FindFirstChild("Owner").Value
  108. elseif targ.Parent.Parent.Parent.Parent.Parent:FindFirstChild("Owner") then
  109. owner = targ.Parent.Parent.Parent.Parent.Parent:FindFirstChild("Owner").Value
  110. end
  111. if hack then
  112. hack.Active:Destroy()
  113. hack.Success.Visible = true
  114. game.Workspace.Remotes.openSesame:FireServer(targ)
  115. TutorialService.transitionStage(nil, "HackAVault", "StealSomeCoins")
  116. wait(2)
  117. hack:Destroy()
  118. end
  119. if prev and prev:FindFirstChild("SelectionBox") then
  120. prev:FindFirstChild("SelectionBox"):Destroy()
  121. prev = nil
  122. end
  123. else
  124. game.Workspace.Remotes.alertPlayer:FireServer("You cannot hack your own vault!")
  125. hack:Destroy()
  126. end
  127. end)
  128. return prev, once
  129. end
  130. function onEquipped()
  131. link = mouse.Button1Down:connect(function()
  132. local targ = mouse.Target
  133. local encryption = -1
  134. if player.Team.Vault.Value:FindFirstChild("Encryption") then
  135. encryption = player.Team.Vault.Value:FindFirstChild("Encryption").Value
  136. end
  137. if targ and targ ~= prev and targ.Name == "Panel" and (targ.Parent:FindFirstChild("Toggle") or targ.Parent.Parent:FindFirstChild("Toggle")) and player:DistanceFromCharacter(targ.Position) < 50 and player.PlayerGui:FindFirstChild("HackGui") == nil then
  138. if (targ.Parent.Parent.Name == "Teleport1" or targ.Parent.Parent.Name == "Teleport2") and encryption > 0 or encryption < 0 or targ.Parent.Name == "Interactive" then
  139. prev, once = promptHack(targ, prev, once)
  140. prev = targ
  141. prev = watch(prev)
  142. elseif targ.Parent.Parent.Name == "Teleport1" or targ.Parent.Parent.Name == "Teleport2" then
  143. local knack = script.HackGui:Clone()
  144. knack.Prompt.Visible = false
  145. knack.Knack.Visible = true
  146. knack.Knack.Need.Text = "You need the Basic Hacker Pass to hack this portal"
  147. knack.Parent = player.PlayerGui
  148. wait(5)
  149. knack:Destroy()
  150. end
  151. if (targ.Parent.Parent.Name == "Teleport3" or targ.Parent.Parent.Name == "Teleport4") and encryption > 1 then
  152. prev, once = promptHack(targ, prev, once)
  153. prev = targ
  154. prev = watch(prev)
  155. elseif targ.Parent.Parent.Name == "Teleport3" or targ.Parent.Parent.Name == "Teleport4" then
  156. local knack = script.HackGui:Clone()
  157. knack.Prompt.Visible = false
  158. knack.Knack.Visible = true
  159. knack.Knack.Need.Text = "You need the Advanced Hacker Pass to hack this portal"
  160. knack.Parent = player.PlayerGui
  161. wait(5)
  162. knack:Destroy()
  163. end
  164. if (targ.Parent.Parent.Name == "Teleport5" or targ.Parent.Parent.Name == "Teleport6") and encryption > 2 then
  165. prev, once = promptHack(targ, prev, once)
  166. prev = targ
  167. prev = watch(prev)
  168. elseif targ.Parent.Parent.Name == "Teleport5" or targ.Parent.Parent.Name == "Teleport5" then
  169. local knack = script.HackGui:Clone()
  170. knack.Prompt.Visible = false
  171. knack.Knack.Visible = true
  172. knack.Knack.Need.Text = "You need the Elite Hacker Pass to hack this portal"
  173. knack.Parent = player.PlayerGui
  174. wait(5)
  175. knack:Destroy()
  176. end
  177. else
  178. if prev and prev:FindFirstChild("SelectionBox") then
  179. prev:FindFirstChild("SelectionBox"):Destroy()
  180. prev = nil
  181. end
  182. if player.PlayerGui:FindFirstChild("HackGui") then
  183. player.PlayerGui:FindFirstChild("HackGui"):Destroy()
  184. end
  185. end
  186. end)
  187. end
  188. function onUnequipped()
  189. link:Disconnect()
  190. if prev and prev:FindFirstChild("SelectionBox") then
  191. prev:FindFirstChild("SelectionBox"):Destroy()
  192. prev = nil
  193. end
  194. if player.PlayerGui:FindFirstChild("HackGui") then
  195. player.PlayerGui:FindFirstChild("HackGui"):Destroy()
  196. end
  197. end
  198. script.Parent.Equipped:connect(onEquipped)
  199. script.Parent.Unequipped:connect(onUnequipped)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement