Professional Documents
Culture Documents
Doble Salto Script
Doble Salto Script
function onJumpRequest()
if not character or not humanoid or not
character:IsDescendantOf(workspace)or
humanoid:GetState() == Enum.HumanoidStateType.Dead then
return
end
end
humanoid.StateChanged:Connect(function(old, new)
if new == Enum.HumanoidStateType.Landed then
canDoubleJump = false
hasDoubleJumped = false
humanoid.JumpPower = oldPower
elseif new == Enum.HumanoidStateType.Freefall then
wait(TIME_BETWEEN_JUMPS)
canDoubleJump = true
end
end)
end
if localPlayer.Character then
characterAdded(localPlayer.Character)
end
localPlayer.CharacterAdded:Connect(characterAdded)
UserInputService.JumpRequest:Connect(onJumpRequest)