Advertisement
VuaxExploits

Untitled

Dec 31st, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1.  
  2. -- model script by bertan9994 --
  3.  
  4. local UIS = game:GetService("UserInputService")
  5. local player = game.Players.LocalPlayer
  6. local character
  7. local humanoid
  8.  
  9. local canDoubleJump = false
  10. local hasDoubleJumped = false
  11. local oldPower
  12. local time_delay = 0.2
  13. local jump_multiplier = 2
  14.  
  15. function onJumpRequest()
  16. if not character or not humanoid or not character:IsDescendantOf(workspace) or humanoid:GetState() == Enum.HumanoidStateType.Dead then
  17. return
  18. end
  19.  
  20. if canDoubleJump and not hasDoubleJumped then
  21. hasDoubleJumped = true
  22. humanoid.JumpPower = oldPower * jump_multiplier
  23. humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
  24. end
  25. end
  26.  
  27. local function characterAdded(new)
  28. character = new
  29. humanoid = new:WaitForChild("Humanoid")
  30. hasDoubleJumped = false
  31. canDoubleJump = false
  32. oldPower = humanoid.JumpPower
  33.  
  34. humanoid.StateChanged:connect(function(old, new)
  35. if new == Enum.HumanoidStateType.Landed then
  36. canDoubleJump = false
  37. hasDoubleJumped = false
  38. humanoid.JumpPower = oldPower
  39. elseif new == Enum.HumanoidStateType.Freefall then
  40. wait(time_delay)
  41. canDoubleJump = true
  42. end
  43. end)
  44. end
  45.  
  46. if player.Character then
  47. characterAdded(player.Character)
  48. end
  49.  
  50. player.CharacterAdded:connect(characterAdded)
  51. UIS.JumpRequest:connect(onJumpRequest)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement