Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game:GetService("Players").LocalPlayer or game:GetService("Players"):GetPropertyChangedSignal("LocalPlayer"):Wait() or game:GetService("Players").LocalPlayer
- local CargoTrainRedCartExample = workspace.Trains:FindFirstChild("BoxCar") or workspace.Trains:FindFirstChild("VBoxCar")
- local v30 = Vector3.new()
- local root = game:GetService("Players").LocalPlayer.Character:WaitForChild("HumanoidRootPart")
- local humanoid = game:GetService("Players").LocalPlayer.Character:WaitForChild("Humanoid")
- local VirtualInput = game:GetService("VirtualInputManager")
- local Stepped = game:GetService("RunService").Stepped
- local function triggerSpec(part)
- if abort then return end
- --look at it then press key
- local cam = workspace.CurrentCamera
- cam.CameraType = "Scriptable"
- cam.CFrame = CFrame.new(cam.CFrame.p,part.Position)
- wait()
- cam.CameraType = "Custom"
- wait()
- VirtualInput:SendKeyEvent(true, "E", false, game)
- end
- local function waitWhile(t,exitFunc)
- local elapsed = 0
- local increment = 0.1
- t = (t == nil or t <= 0) and 0.001 or t
- increment = (increment > t) and t or increment
- while elapsed < t and (exitFunc==nil or exitFunc(elapsed)) do
- elapsed = elapsed + wait(t-elapsed < increment and t-elapsed or increment)
- end
- return elapsed
- end
- local bigTPcf1 = CFrame.new(-54,245,1126)
- local bigTPcf2 = CFrame.new(118,124,1309)
- local function bigTP(cf,sign)
- --Shit method for free compatibility. Use better methods.
- sign = sign or 1
- player.PlayerGui.MainGui.Minimap.ImageLabel.Visible = false
- workspace.CurrentCamera.CameraType = "Scriptable"
- while (root.CFrame.p - cf.p).magnitude > 4 and not abort do
- local bigTPcf = (root.CFrame.p - bigTPcf1.p).magnitude > 100 and bigTPcf1 or bigTPcf2
- stepconn = Stepped:Connect(function()
- root.CFrame = bigTPcf
- root.Velocity,root.RotVelocity=v30,v30
- end)
- waitWhile(3,function() return root:FindFirstChild("BodyGyro")==nil end)
- stepconn:Disconnect()
- if root:FindFirstChild("BodyVelocity") then root.BodyVelocity.Parent = nil end
- if not abort then
- root.CFrame = cf + Vector3.new(0,5*sign,0)
- stepconn = Stepped:Connect(function() root.Velocity,root.RotVelocity=v30,v30 end)
- end
- if root.Parent and root.Parent:FindFirstChild("Parachute") then
- root.Parent["Parachute"]:Destroy()
- end
- waitWhile(0.2)
- if root.Parent and root.Parent:FindFirstChild("Parachute") then
- root.Parent["Parachute"]:Destroy()
- end
- if not abort then root.CFrame = cf end
- waitWhile(0.3)
- stepconn:Disconnect()
- end
- player.PlayerGui.MainGui.Minimap.ImageLabel.Visible = true
- workspace.CurrentCamera.CameraType = "Custom"
- end
- for _,part in ipairs(workspace.Buildings:GetChildren()) do
- if (part.Position-Vector3.new(-302.6,30.3,1431.9)).magnitude < 1 then
- part.CanCollide=false
- end
- end
- game:GetService("Workspace").DroppedCash.ChildAdded:Connect(function(obj)
- bigTP(obj.CFrame)
- wait()
- triggerSpec(obj)
- waitWhile(4,function() return obj==nil end)
- VirtualInput:SendKeyEvent(false, "E", false, game)
- end)
- for i,v in pairs(game:GetService("Workspace").DroppedCash:GetChildren()) do
- if v then
- bigTP(v.CFrame)
- wait()
- triggerSpec(v)
- waitWhile(4,function() return v==nil end)
- VirtualInput:SendKeyEvent(false, "E", false, game)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement