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)