Advertisement
cat568

Untitled

Apr 10th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. local play = game.Players.LocalPlayer
  2. local userinput = game:GetService("UserInputService")
  3. local char = play.Character
  4. local root = char:WaitForChild("HumanoidRootPart")
  5. local inair = false
  6. local canjump = true
  7. local hum = char:WaitForChild("Humanoid")
  8.  
  9.  
  10. hum.StateChanged:connect(function(old,new)
  11. if new == Enum.HumanoidStateType.Freefall or new == Enum.HumanoidStateType.Jumping then
  12. inair = true
  13. else
  14. inair = false
  15. canjump = true
  16. end
  17. end)
  18.  
  19.  
  20. userinput.InputBegan:connect(function(input)
  21. if input.KeyCode == Enum.KeyCode.Space and inair == true and canjump == true then
  22. root.Velocity = Vector3.new(root.Velocity.X,hum.JumpPower,root.Velocity.Z)
  23. canjump = false
  24. end
  25. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement