Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local play = game.Players.LocalPlayer
- local userinput = game:GetService("UserInputService")
- local char = play.Character
- local root = char:WaitForChild("HumanoidRootPart")
- local inair = false
- local canjump = true
- local hum = char:WaitForChild("Humanoid")
- hum.StateChanged:connect(function(old,new)
- if new == Enum.HumanoidStateType.Freefall or new == Enum.HumanoidStateType.Jumping then
- inair = true
- else
- inair = false
- canjump = true
- end
- end)
- userinput.InputBegan:connect(function(input)
- if input.KeyCode == Enum.KeyCode.Space and inair == true and canjump == true then
- root.Velocity = Vector3.new(root.Velocity.X,hum.JumpPower,root.Velocity.Z)
- canjump = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement