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
- forwardLoop = RunService.Heartbeat:Connect(function()
- thruster.MaxForce = Vector3.new(5000, 5000, 5000)
- thruster.Velocity = Vector3.new(0, 20, 0) + workspace.CurrentCamera.CFrame.LookVector * 35
- if character.Humanoid.FloorMaterial ~= Enum.Material.Air and thruster.Velocity.Y <= 0 then
- thruster.MaxForce = Vector3.new()
- end
- 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