Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --SynapseX Decompiler
- local TutorialService = require(game.ReplicatedStorage.LocalModules.TutorialService)
- local player = game.Players.LocalPlayer
- local mouse = player:GetMouse()
- local prev, link
- local playerSpeed, playerTime = game.Workspace.Remotes.getHackSpeed:InvokeServer(player)
- local once = 0
- local messages = {
- "Articulating Protocols",
- "Modulating Circuits",
- "Rewiring Sensors",
- "Provoking Firewall",
- "Decrypting PSK",
- "Backtracking Rabithole",
- "Spraying UBIK",
- "Consulting the I Ching",
- "Polarizing Capasitors",
- "Playing Song 1994",
- "Regulating Paths",
- "Circumventing Defences",
- "Shutting Down Interface",
- "Collecting Meta Data",
- "Populating Cache",
- "Ejecting Cores",
- "Concocting Concoctions"
- }
- function watch(prev)
- while prev and player:DistanceFromCharacter(prev.Position) < 50 do
- wait(1)
- end
- if prev and prev:FindFirstChild("SelectionBox") then
- prev:FindFirstChild("SelectionBox"):Destroy()
- end
- return nil
- end
- function promptHack(targ, prev, once)
- TutorialService.transitionStage(nil, "UseTheHackdar", "HackAVault")
- local sb = script.SelectionBox:Clone()
- sb.Parent = targ
- sb.Adornee = targ
- if prev and prev:FindFirstChild("SelectionBox") then
- prev:FindFirstChild("SelectionBox"):Destroy()
- prev = nil
- end
- local hack = script.HackGui:Clone()
- local enLevel = 0
- if targ.Parent:FindFirstChild("Encryption") then
- enLevel = targ.Parent.Encryption.Value
- else
- hack.Prompt.Encryption.Visible = false
- hack.Success.Time2.Text = "Open for 30s"
- end
- local estTime = 10
- if enLevel ~= 0 then
- if playerTime and enLevel then
- estTime = playerTime * enLevel
- end
- else
- estTime = math.ceil(playerTime / 3)
- end
- hack.Prompt.Time.Text = "Estimated Time: " .. estTime .. "s"
- hack.Prompt.Encryption.Text = "Encryption Level " .. enLevel
- hack.Prompt.Encryption.TextColor3 = Color3.new(enLevel / 5, 1 - enLevel / 5, 0)
- if targ.Parent.Parent:FindFirstChild("Toggle") then
- hack.Prompt.Thing.Text = "Portal"
- else
- hack.Prompt.Thing.Text = targ.Parent.ObjName.Value
- end
- hack.Parent = player.PlayerGui
- hack.Prompt.Hack.MouseButton1Click:connect(function()
- local vaultComplex = targ:FindFirstAncestor("Vault")
- if vaultComplex ~= nil then
- vaultComplex = vaultComplex.Parent
- else
- vaultComplex = targ:FindFirstAncestor("Scripted").Parent
- end
- if not TutorialService.skipped() or vaultComplex ~= nil and vaultComplex.Owner.Value ~= player.Name then
- hack.Prompt:Destroy()
- hack.Active.Visible = true
- hack.Active.Time.Text = "Estimated Time Left: " .. estTime .. "s"
- local errors = 0
- for i = 1, estTime * 10 do
- wait(0.1)
- if hack and hack:FindFirstChild("Active") then
- local passOrfail = math.random(10 * playerSpeed) == 1
- hack.Active.Time.Text = "Estimated Time Left: " .. estTime - i * 0.1 .. "s"
- if not passOrfail then
- hack.Active.LoadBar.Size = UDim2.new(i / (estTime * 10), 0, 0.5, 0)
- else
- errors = errors + 1
- i = i - 1
- hack.Active.Errors.Text = "Errors: " .. errors
- end
- if i % 20 == 0 then
- hack.Active.Message.Text = messages[math.random(#messages)]
- end
- if i % 10 == 0 and player:DistanceFromCharacter(targ.Position) >= 50 then
- hack:Destroy()
- end
- end
- end
- local owner
- if targ.Parent.Parent:FindFirstChild("Owner") then
- owner = targ.Parent.Parent:FindFirstChild("Owner").Value
- elseif targ.Parent.Parent.Parent:FindFirstChild("Owner") then
- owner = targ.Parent.Parent.Parent:FindFirstChild("Owner").Value
- elseif targ.Parent.Parent.Parent.Parent.Parent:FindFirstChild("Owner") then
- owner = targ.Parent.Parent.Parent.Parent.Parent:FindFirstChild("Owner").Value
- end
- if hack then
- hack.Active:Destroy()
- hack.Success.Visible = true
- game.Workspace.Remotes.openSesame:FireServer(targ)
- TutorialService.transitionStage(nil, "HackAVault", "StealSomeCoins")
- wait(2)
- hack:Destroy()
- end
- if prev and prev:FindFirstChild("SelectionBox") then
- prev:FindFirstChild("SelectionBox"):Destroy()
- prev = nil
- end
- else
- game.Workspace.Remotes.alertPlayer:FireServer("You cannot hack your own vault!")
- hack:Destroy()
- end
- end)
- return prev, once
- end
- function onEquipped()
- link = mouse.Button1Down:connect(function()
- local targ = mouse.Target
- local encryption = -1
- if player.Team.Vault.Value:FindFirstChild("Encryption") then
- encryption = player.Team.Vault.Value:FindFirstChild("Encryption").Value
- end
- 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
- if (targ.Parent.Parent.Name == "Teleport1" or targ.Parent.Parent.Name == "Teleport2") and encryption > 0 or encryption < 0 or targ.Parent.Name == "Interactive" then
- prev, once = promptHack(targ, prev, once)
- prev = targ
- prev = watch(prev)
- elseif targ.Parent.Parent.Name == "Teleport1" or targ.Parent.Parent.Name == "Teleport2" then
- local knack = script.HackGui:Clone()
- knack.Prompt.Visible = false
- knack.Knack.Visible = true
- knack.Knack.Need.Text = "You need the Basic Hacker Pass to hack this portal"
- knack.Parent = player.PlayerGui
- wait(5)
- knack:Destroy()
- end
- if (targ.Parent.Parent.Name == "Teleport3" or targ.Parent.Parent.Name == "Teleport4") and encryption > 1 then
- prev, once = promptHack(targ, prev, once)
- prev = targ
- prev = watch(prev)
- elseif targ.Parent.Parent.Name == "Teleport3" or targ.Parent.Parent.Name == "Teleport4" then
- local knack = script.HackGui:Clone()
- knack.Prompt.Visible = false
- knack.Knack.Visible = true
- knack.Knack.Need.Text = "You need the Advanced Hacker Pass to hack this portal"
- knack.Parent = player.PlayerGui
- wait(5)
- knack:Destroy()
- end
- if (targ.Parent.Parent.Name == "Teleport5" or targ.Parent.Parent.Name == "Teleport6") and encryption > 2 then
- prev, once = promptHack(targ, prev, once)
- prev = targ
- prev = watch(prev)
- elseif targ.Parent.Parent.Name == "Teleport5" or targ.Parent.Parent.Name == "Teleport5" then
- local knack = script.HackGui:Clone()
- knack.Prompt.Visible = false
- knack.Knack.Visible = true
- knack.Knack.Need.Text = "You need the Elite Hacker Pass to hack this portal"
- knack.Parent = player.PlayerGui
- wait(5)
- knack:Destroy()
- end
- else
- if prev and prev:FindFirstChild("SelectionBox") then
- prev:FindFirstChild("SelectionBox"):Destroy()
- prev = nil
- end
- if player.PlayerGui:FindFirstChild("HackGui") then
- player.PlayerGui:FindFirstChild("HackGui"):Destroy()
- end
- end
- end)
- end
- function onUnequipped()
- link:Disconnect()
- if prev and prev:FindFirstChild("SelectionBox") then
- prev:FindFirstChild("SelectionBox"):Destroy()
- prev = nil
- end
- if player.PlayerGui:FindFirstChild("HackGui") then
- player.PlayerGui:FindFirstChild("HackGui"):Destroy()
- end
- end
- script.Parent.Equipped:connect(onEquipped)
- script.Parent.Unequipped:connect(onUnequipped)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement