Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local CAS = game:GetService("ContextActionService")
- local RunService = game:GetService("RunService")
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local forwardLoop
- local thruster = Instance.new("BodyVelocity")
- thruster.MaxForce = Vector3.new()
- thruster.Parent = character.HumanoidRootPart
- local jetpack_on = false
- local function jetpack()
- jetpack_on = not jetpack_on
- print("Jetpack:", jetpack_on)
- if jetpack_on then
- thruster.MaxForce = Vector3.new(5000, 5000, 5000)
- forwardLoop = RunService.Heartbeat:Connect(function()
- thruster.Velocity = Vector3.new(0, 20, 0) + character.HumanoidRootPart.CFrame.LookVector * 30
- end)
- return
- end
- thruster.MaxForce = Vector3.new()
- forwardLoop:Disconnect()
- end
- CAS:BindAction("Jetpack", jetpack, false, Enum.KeyCode.LeftShift)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement