Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local doJewl=true
- local doBank=true
- local doTrain=true
- local green,red=Color3.fromRGB(0,240,0),Color3.fromRGB(240,0,0)
- local maxSpeed = 375 --max studs/s by anti exploit
- local vaultMaxSecs = 999
- local jewlAllowCrims = false
- --interface
- local gui = Instance.new("ScreenGui")
- gui.ResetOnSpawn=false
- gui.Name = "AutoRob"
- local main = Instance.new("Frame",gui)
- main.BackgroundTransparency=0.02
- main.BackgroundColor3=Color3.fromRGB(0,50,100)
- main.Active=true
- main.Draggable=true
- main.Position=UDim2.new(0.2,0,0.2,0)
- main.Size=UDim2.new(0,350,0,234)
- main.ZIndex=3
- local indent = Instance.new("Frame",main)
- indent.BackgroundTransparency=1
- indent.Position=UDim2.new(0,25,0,25)
- indent.Size=UDim2.new(1,-50,1,-50)
- local CloseBtn = Instance.new("TextButton",main)
- CloseBtn.BackgroundTransparency=1
- CloseBtn.Position=UDim2.new(1,-20,0,0)
- CloseBtn.Size=UDim2.new(0,20,0,20)
- CloseBtn.Font=Enum.Font.SourceSansBold
- CloseBtn.Text="X"
- CloseBtn.TextScaled=true
- CloseBtn.TextColor3=Color3.new(1,1,1)
- CloseBtn.TextStrokeTransparency=0.7
- local CogBtn = Instance.new("ImageButton",main)
- CogBtn.BackgroundTransparency=1
- CogBtn.Position=UDim2.new(0,0,0,0)
- CogBtn.Size=UDim2.new(0,20,0,20)
- CogBtn.Image="rbxassetid://135740223"
- local AbortBtn = Instance.new("TextButton",indent)
- AbortBtn.Style=Enum.ButtonStyle.RobloxRoundButton
- AbortBtn.AutoButtonColor=false
- AbortBtn.Position=UDim2.new(0.25,0,0.6,-5)
- AbortBtn.Size=UDim2.new(0.5,0,0.185,0)
- AbortBtn.Font=Enum.Font.SourceSans
- AbortBtn.Text="ABORT"
- AbortBtn.TextScaled=false
- AbortBtn.TextSize=25
- local JewlBtn = Instance.new("TextButton",indent)
- JewlBtn.BackgroundColor3=doJewl and green or red
- JewlBtn.Position=UDim2.new(0.8)
- JewlBtn.Size=UDim2.new(0.2,0,0.185,-5)
- JewlBtn.Font=Enum.Font.SourceSansSemibold
- JewlBtn.Text=doJewl and "YES" or "NO"
- JewlBtn.TextScaled=true
- local BankBtn = Instance.new("TextButton",indent)
- BankBtn.BackgroundColor3=doBank and green or red
- BankBtn.Position=UDim2.new(0.8,0,0.2,0)
- BankBtn.Size=UDim2.new(0.2,0,0.185,-5)
- BankBtn.Font=Enum.Font.SourceSansSemibold
- BankBtn.Text=doBank and "YES" or "NO"
- BankBtn.TextScaled=true
- local TrainBtn = Instance.new("TextButton",indent)
- TrainBtn.BackgroundColor3=doTrain and green or red
- TrainBtn.Position=UDim2.new(0.8,0,0.4,0)
- TrainBtn.Size=UDim2.new(0.2,0,0.185,-5)
- TrainBtn.Font=Enum.Font.SourceSansSemibold
- TrainBtn.Text=doTrain and "YES" or "NO"
- TrainBtn.TextScaled=true
- local lbl1 = Instance.new("TextLabel",indent)
- lbl1.BackgroundTransparency=1
- lbl1.Position=UDim2.new(0,0,0,-5)
- lbl1.Size=UDim2.new(0.8,0,0.185,0)
- lbl1.Font=Enum.Font.SourceSans
- lbl1.Text="Auto Rob Jewelry:"
- lbl1.TextScaled=true
- lbl1.TextColor3=Color3.new(1,1,1)
- lbl1.TextStrokeTransparency=0.8
- local lbl2 = Instance.new("TextLabel",indent)
- lbl2.BackgroundTransparency=1
- lbl2.Position=UDim2.new(0,0,0.2,-7)
- lbl2.Size=UDim2.new(0.8,0,0.185,0)
- lbl2.Font=Enum.Font.SourceSans
- lbl2.Text="Auto Rob Bank:"
- lbl2.TextScaled=true
- lbl2.TextColor3=Color3.new(1,1,1)
- lbl2.TextStrokeTransparency=0.8
- local lbl3 = Instance.new("TextLabel",indent)
- lbl3.BackgroundTransparency=1
- lbl3.Position=UDim2.new(0,0,0.4,-7)
- lbl3.Size=UDim2.new(0.8,0,0.185,0)
- lbl3.Font=Enum.Font.SourceSans
- lbl3.Text="Auto Rob Train:"
- lbl3.TextScaled=true
- lbl3.TextColor3=Color3.new(1,1,1)
- lbl3.TextStrokeTransparency=0.8
- local Status = Instance.new("TextLabel",indent)
- Status.BackgroundTransparency=0.25
- Status.BackgroundColor3=Color3.new(1,1,1)
- Status.Position=UDim2.new(0,0,0.8,0)
- Status.Size=UDim2.new(1,0,0.185,0)
- Status.Font=Enum.Font.Code
- Status.Text="Status:"
- Status.TextScaled=false
- Status.TextSize=15
- Status.TextXAlignment=Enum.TextXAlignment.Left
- local setsframe = Instance.new("Frame",main)
- setsframe.BackgroundTransparency=0.02
- setsframe.BackgroundColor3=Color3.new(.88,.88,.88)
- setsframe.BorderColor3=main.BackgroundColor3
- setsframe.BorderSizePixel=5
- setsframe.Position=UDim2.new(0,50,1,-70)
- setsframe.Size=UDim2.new(0,240,0,65)
- local setsoption1 = Instance.new("Frame",setsframe)
- setsoption1.BackgroundTransparency=1
- setsoption1.Size=UDim2.new(1,0,0.5,0)
- local indent1 = Instance.new("Frame",setsoption1)
- indent1.BackgroundTransparency=1
- indent1.Position=UDim2.new(0,5,0,5)
- indent1.Size=UDim2.new(1,-10,1,-10)
- local lbl4 = Instance.new("TextLabel",indent1)
- lbl4.BackgroundTransparency=1
- lbl4.Size=UDim2.new(0.8,0,1,0)
- lbl4.Font=Enum.Font.SourceSans
- lbl4.Text="Max Secs Inside Vaults"
- lbl4.TextScaled=true
- local MaxSecsBox = Instance.new("TextBox",indent1)
- MaxSecsBox.BackgroundColor3=Color3.new(.95,.95,.95)
- MaxSecsBox.Position=UDim2.new(0.83,0,0.2,0)
- MaxSecsBox.Size=UDim2.new(0,30,0,15)
- MaxSecsBox.Font=Enum.Font.Code
- MaxSecsBox.Text=tostring(vaultMaxSecs)
- MaxSecsBox.TextScaled=true
- local setsoption2 = Instance.new("Frame",setsframe)
- setsoption2.BackgroundTransparency=0.95
- setsoption2.BackgroundColor3=Color3.new()
- setsoption2.Position=UDim2.new(0,0,0.5,0)
- setsoption2.Size=UDim2.new(1,0,0.5,0)
- local indent2 = Instance.new("Frame",setsoption2)
- indent2.BackgroundTransparency=1
- indent2.Position=UDim2.new(0,5,0,5)
- indent2.Size=UDim2.new(1,-10,1,-10)
- local lbl5 = Instance.new("TextLabel",indent2)
- lbl5.BackgroundTransparency=1
- lbl5.Size=UDim2.new(0.8,0,1,0)
- lbl5.Font=Enum.Font.SourceSans
- lbl5.Text="Let Crims Enter Jewelry"
- lbl5.TextScaled=true
- local JewlSetBtn = Instance.new("TextButton",indent2)
- JewlSetBtn.BackgroundColor3=Color3.new(.95,.95,.95)
- JewlSetBtn.Position=UDim2.new(0.85,0,0.2,0)
- JewlSetBtn.Size=UDim2.new(0,20,0,15)
- JewlSetBtn.Font=Enum.Font.SourceSansSemibold
- JewlSetBtn.Text=jewlAllowCrims and "X" or ""
- JewlSetBtn.TextScaled=false
- JewlSetBtn.TextSize=20
- gui.Parent = game.CoreGui
- for _,v in ipairs(main:GetChildren()) do
- if v~=setsframe then v.ZIndex = 4 end
- end
- for _,v in ipairs(indent:GetChildren()) do
- v.ZIndex = 5
- end
- local player = game:GetService("Players").LocalPlayer
- local root
- local abort=false
- --gui code
- CloseBtn.MouseButton1Click:Connect(function() gui:Destroy() abort=true end)
- CloseBtn.MouseEnter:Connect(function() CloseBtn.TextColor3=red end)
- CloseBtn.MouseLeave:Connect(function() CloseBtn.TextColor3=Color3.new(1,1,1) end)
- JewlBtn.MouseButton1Click:Connect(function()
- doJewl = not doJewl
- JewlBtn.BackgroundColor3=doJewl and green or red
- JewlBtn.Text=doJewl and "YES" or "NO"
- end)
- BankBtn.MouseButton1Click:Connect(function()
- doBank = not doBank
- BankBtn.BackgroundColor3=doBank and green or red
- BankBtn.Text=doBank and "YES" or "NO"
- end)
- TrainBtn.MouseButton1Click:Connect(function()
- doTrain = not doTrain
- TrainBtn.BackgroundColor3=doTrain and green or red
- TrainBtn.Text=doTrain and "YES" or "NO"
- end)
- local function toggleCanAbort(bool)
- AbortBtn.AutoButtonColor=bool
- AbortBtn.Style=bool and "RobloxRoundDefaultButton" or "RobloxRoundButton"
- end
- AbortBtn.MouseButton1Click:Connect(function()
- if AbortBtn.AutoButtonColor==true then
- toggleCanAbort(false)
- local hit,p = workspace:FindPartOnRay(Ray.new(player.Character.Head.Position+Vector3.new(0,10,0),Vector3.new(0,20,0)))
- if hit then
- player.Character:MoveTo(p)
- else
- root.CFrame=root.CFrame+Vector3.new(-40,2,0)
- end
- abort=true
- AbortBtn.Text = "Aborted."
- wait(3)
- abort=false
- wait(7)
- AbortBtn.Text = "ABORT"
- end
- end)
- local function stprint(txt)
- Status.Text = "Status: "..txt
- end
- local function strToNum(str)
- return tonumber((tostring(str):gsub("[^%d]", "")))
- end
- local tweenCogOut = game:GetService("TweenService"):Create(CogBtn,TweenInfo.new(0.3),{Rotation=135})
- local tweenCogIn = game:GetService("TweenService"):Create(CogBtn,TweenInfo.new(0.3),{Rotation=0})
- local cogOut = false
- CogBtn.MouseButton1Click:Connect(function()
- cogOut = not cogOut
- if cogOut then
- setsframe:TweenPosition(UDim2.new(0,50,1,0),nil,"Quart",0.3,true)
- tweenCogOut:Play()
- else
- setsframe:TweenPosition(UDim2.new(0,50,1,-70),nil,"Quart",0.3,true)
- tweenCogIn:Play()
- end
- end)
- MaxSecsBox:GetPropertyChangedSignal("Text"):Connect(function()
- local num = strToNum(MaxSecsBox.Text),1,999
- if num then
- num = math.clamp(num,1,999)
- vaultMaxSecs = num
- MaxSecsBox.Text = tostring(num)
- else
- MaxSecsBox.Text = ''
- end
- end)
- MaxSecsBox.FocusLost:Connect(function() MaxSecsBox.Text=tostring(vaultMaxSecs) end)
- JewlSetBtn.MouseButton1Click:Connect(function()
- jewlAllowCrims = not jewlAllowCrims
- JewlSetBtn.Text = jewlAllowCrims and "X" or ""
- end)
- --main code
- local windowFocused = false
- game:GetService("UserInputService").WindowFocused:Connect(function() windowFocused=true end)
- game:GetService("UserInputService").WindowFocusReleased:Connect(function() windowFocused=false end)
- local punchEvent,punchCode,trainEvent,trainCode
- local function keyclick(num)
- if windowFocused and keypress and keyrelease then
- keypress(num)
- wait()
- keyrelease(num)
- end
- end
- local function punch()
- if punchEvent then
- punchEvent:FireServer(unpack(punchCode))
- elseif windowFocused then
- keyclick(0x46)
- end
- end
- local function exitVehicle() keyclick(0x20) end
- local function longTP(cf)
- local original = root.CFrame + Vector3.new(0,math.max(0,140-root.CFrame.y),0) --start high up
- local oldg = workspace.Gravity
- workspace.Gravity=0
- --consistent velocity along a theoretical array of points between
- for i=0,1,1/((original.p-cf.p).magnitude / (maxSpeed*0.25)) do
- if abort then break end
- root.CFrame = original:lerp(cf,i)
- root.Velocity=Vector3.new()
- wait(0.25)
- end
- workspace.Gravity=oldg
- for i=1,5 do
- if abort then break end
- root.CFrame = cf
- wait(0.1)
- end
- wait(0.1)
- end
- local function bigTP(cf)
- repeat
- for i=1,60 do
- if abort then return end
- root.CFrame=cf
- wait()
- end
- until wait(0.3) and (root.Position-cf.p).magnitude<9
- end
- local function isBagFull()
- if player.PlayerGui.MainGui.CollectMoney.Visible==false then
- return true
- end
- return strToNum(player.PlayerGui.MainGui.CollectMoney.Money.Text)+1 >= strToNum(player.PlayerGui.MainGui.CollectMoney.Maximum.Text)
- end
- local boxcars = {}
- for _,v in ipairs(workspace.Trains:GetChildren()) do
- if v.Name=="BoxCar" and v:FindFirstChild("Gold",true) then
- boxcars[#boxcars+1]=v
- end
- end
- workspace.Trains.ChildAdded:Connect(function(child)
- wait(10.5)
- if child.Name=="BoxCar" and child.Model.Rob:FindFirstChild("Gold") then
- boxcars[#boxcars+1]=child
- end
- end)
- workspace.Trains.ChildRemoved:Connect(function(child)
- for i,car in ipairs(boxcars) do
- if car==child then
- table.remove(boxcars,i)
- break
- end
- end
- end)
- --pcall(function()
- local MT = getrawmetatable(game)
- if setreadonly then setreadonly(MT,false) end
- if make_writeable then make_writeable(MT) end
- local oldNamecall = MT.__namecall
- local oldIndex = MT.__index
- local oldWTSP = workspace.CurrentCamera.WorldToScreenPoint
- MT.__namecall = function(inst,...)
- local args = {...}
- local m = args[#args]
- if m == "WorldToScreenPoint" and inst.ClassName=="Camera" then
- local ret = oldWTSP(inst,...)
- return ret,true
- end
- return oldNamecall(inst,...)
- end
- MT.__index = function(inst,k)
- if k=="Velocity" and inst==root then
- return Vector3.new()
- end
- return oldIndex(inst,k)
- end
- if setreadonly then setreadonly(MT,true) end
- --end)
- local function isVaultOpenAndCopsTooClose()
- if (workspace.Banks:GetChildren()[1].Door.Closed.Position-Vector3.new(25.6,3.6,815.6)).magnitude > 1 then
- for _,p in ipairs(game:GetService("Teams").Police:GetPlayers()) do
- if p.Character and p.Character:FindFirstChild("HumanoidRootPart") then
- local diff = (p.Character.HumanoidRootPart.Position-root.Position)
- if diff.magnitude < 40 and (diff*Vector3.new(0,1,0)).magnitude < 10 then
- return true
- end
- end
- end
- end
- return false
- end
- local function warnFlash()
- stprint("About to TP")
- local col0 = main.BackgroundColor3
- for i=1,2 do
- for a=0,1,1/(30*.25) do
- main.BackgroundColor3 = col0:lerp(red,a)
- wait()
- end
- for a=0,1,1/(30*.25) do
- main.BackgroundColor3 = red:lerp(col0,a)
- wait()
- end
- end
- main.BackgroundColor3 = col0
- end
- local function robJewelry()
- warnFlash()
- stprint("TPing to jewelry...")
- exitVehicle()
- toggleCanAbort(true)
- bigTP(CFrame.new(163.7, 106.6, 1341.6))
- if abort then return end
- root.CFrame = CFrame.new(142.169, 17.88, 1351.084)
- wait(0.5)
- stprint("Robbery started!")
- local notRinging = #workspace.Ringers.Jewelry:GetChildren()==0
- local broke = 0
- for _,box in ipairs(workspace.Jewelrys:GetChildren()[1].Boxes:GetChildren()) do
- if abort or (broke>2 and isBagFull()) then
- --duffel bag full
- break
- end
- local dir = ((box.Position.Z > 1338) and -1) or 1
- if box.Transparency < 0.9 then
- if box.Position.X < 115 and box.Position.Z > 1330 then
- root.CFrame = CFrame.new(box.Position+box.CFrame.lookVector*2.5+Vector3.new(0,0,-2.5),box.Position)
- elseif box.Position.Z > 1338 then
- root.CFrame = CFrame.new(box.Position+box.CFrame.lookVector*-2.5,box.Position)
- else
- root.CFrame = CFrame.new(box.Position+box.CFrame.lookVector*2.5,box.Position)
- end
- wait()
- for i=1,2 do
- if abort~=true and broke==0 and notRinging and jewlAllowCrims then wait(2.25) end
- end
- local hits = 0
- repeat
- punch()
- hits=hits+1
- if punchEvent==nil or (broke==0 and notRinging) then wait(0.5) end
- until abort or hits>7 or box.Transparency>0.9
- if punchEvent~=nil then wait(0.3) end
- broke=broke+1
- end
- end
- wait(0.5)
- stprint("Escaping...")
- bigTP(CFrame.new(-365.3, 35.52, 1578.5))
- toggleCanAbort(false)
- stprint("Jewel success! [10s cooldown]")
- wait(9)
- end
- local function robBank()
- warnFlash()
- stprint("TPing to bank...")
- exitVehicle()
- toggleCanAbort(true)
- bigTP(CFrame.new(119, 95, 840))
- if abort then return end
- root.CFrame = CFrame.new(23.6, 18.07, 853.5)
- wait(0.5)
- if #workspace.Ringers.Bank:GetChildren()==0 then wait(1.5) end
- --gets in vault
- stprint("Robbery started!")
- local elapsed = 0
- for i=1,5 do
- if abort then break end
- root.CFrame = CFrame.new(15.29, 0.76, 825.36)
- elapsed=elapsed+wait(0.5)
- end
- --wait for bag to fill or player leaves
- repeat elapsed=elapsed+wait(0.5) until abort or isBagFull() or isVaultOpenAndCopsTooClose() or elapsed>vaultMaxSecs
- stprint("Escaping...")
- longTP(CFrame.new(119, 95, 840))
- toggleCanAbort(false)
- stprint("Bank success! [10s cooldown]")
- wait(9)
- end
- local function robTrain()
- local bcar,gold = boxcars[1],boxcars[1].Model.Rob.Gold
- local trainFront = workspace.Trains.LocomotiveFront.Model.Front
- warnFlash()
- stprint("TPing to train...")
- exitVehicle()
- toggleCanAbort(true)
- bigTP(gold.CFrame+gold.CFrame.rightVector*10)
- repeat longTP(gold.CFrame+gold.CFrame.rightVector*10)
- until (root.Position-gold.Position).magnitude < 97
- for i=1,5 do
- if abort then break end
- root.CFrame = gold.CFrame+(gold.CFrame.lookVector*3.5)+Vector3.new(0,1,0)
- wait(0.1)
- end
- stprint("Opening vault...")
- local holde=true
- keyclick(0x45)
- if keypress and keyrelease then
- --keypress doesn't seem to "hold" so this is necessary
- spawn(function()
- while wait(0.1) and windowFocused and holde do
- keypress(0x45)
- end
- keyrelease(0x45)
- end)
- end
- if trainEvent then
- trainEvent:FireServer(trainCode,bcar.Skeleton.Vault.Part)
- end
- local elapsed=0
- if not abort then
- repeat
- root.CFrame = gold.CFrame+(gold.CFrame.lookVector*4.5)+Vector3.new(0,1,0)
- elapsed=elapsed+wait(0.25)
- until abort or elapsed>9 or bcar.Skeleton.Vault.Part.Open.Value
- end
- holde,elapsed=false,0
- stprint("Robbery started!")
- if not abort then
- repeat
- root.CFrame = gold.CFrame+gold.CFrame.lookVector+Vector3.new(0,1,0)
- elapsed=elapsed+wait(0.25)
- until abort or (elapsed>4 and isBagFull()) or (trainFront.Position-Vector3.new(-1679,25,268)).magnitude<100 or elapsed>vaultMaxSecs
- end
- stprint("Escaping...")
- bigTP(CFrame.new(-365.3, 35.52, 1578.5))
- toggleCanAbort(false)
- stprint("Train success! [10s cooldown]")
- wait(9)
- end
- local spyfunc = hookfunc or replaceclosure
- if spyfunc then
- local punchWaiting=false
- local oldFS
- oldFS = spyfunc(Instance.new("RemoteEvent").FireServer,function(self,...)
- if punchWaiting then
- punchWaiting=false
- punchEvent = self
- punchCode = {...}
- elseif trainEvent==nil then
- local args = {...}
- if tostring(args[2])=="Part" and workspace.Trains:IsAncestorOf(args[2]) then
- trainEvent = self
- trainCode = args[1]
- end
- end
- return oldFS(self,...)
- end)
- spawn(function()
- repeat
- if windowFocused then punchWaiting=true punch() end
- punchWaiting=false
- wait(0.1)
- until punchEvent~=nil
- end)
- oldWTSP = spyfunc(oldWTSP,function(self,v3)
- local ret = oldWTSP(self,v3)
- return ret,true
- end)
- end
- local function newchar(char)
- if char then root = char:WaitForChild("HumanoidRootPart",4) end
- end
- newchar(player.Character)
- player.CharacterAdded:Connect(newchar)
- --main loop
- local bankSign = workspace.Banks:GetChildren()[1].Extra.Sign.Decal
- local jewlSign = workspace.Jewelrys:GetChildren()[1].Extra.Sign.Decal
- local isBankOpen = bankSign.Transparency>0.01
- local isJewlOpen = jewlSign.Transparency>0.01
- bankSign:GetPropertyChangedSignal("Transparency"):Connect(function() wait() isBankOpen = bankSign.Transparency>0.01 end)
- jewlSign:GetPropertyChangedSignal("Transparency"):Connect(function() wait() isJewlOpen = jewlSign.Transparency>0.01 end)
- local waiti=0
- print("Auto-robbery is running")
- while wait(0.5) and gui.Parent do
- if doJewl and isJewlOpen then
- pcall(robJewelry)
- isJewlOpen=false
- elseif doBank and isBankOpen then
- pcall(robBank)
- isBankOpen=false
- elseif doTrain and #boxcars>0 then
- pcall(robTrain)
- table.remove(boxcars,1)
- else
- stprint("Wait for stores to open".. string.rep('.',waiti%3+1))
- waiti=waiti+1
- end
- end
- return nil
Add Comment
Please, Sign In to add comment