Skip to content

Instantly share code, notes, and snippets.

@sandro
Created May 11, 2017 15:54
Show Gist options
  • Save sandro/2f3c465157fc1835df94e586042894dd to your computer and use it in GitHub Desktop.
Save sandro/2f3c465157fc1835df94e586042894dd to your computer and use it in GitHub Desktop.
local humanoid = script.Parent
local jumpHeight = 50
humanoid.JumpPower = jumpHeight
function onJumpRequest()
if humanoid:GetState() == Enum.HumanoidStateType.Freefall then
humanoid.JumpPower = jumpHeight * 1.5
humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
else
humanoid.JumpPower = jumpHeight
end
end
game:GetService("UserInputService").JumpRequest:connect(onJumpRequest)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment