Disable Jumping

How do I disable jumping for the player upon touching an object?

7 Likes

When a player touches a brick, set their JumpPower to 0.

4 Likes

You can also try disabling the jump state

13 Likes

set the jump power of the player to 0

put a part and insert this script in

script.Parent.Touched:Connect(function(h)
local d = h.Parent:FindFirstChild("Humanoid")
if d then
d.JumpPower = 0
end
end)
29 Likes

Hi there! You can disable jumping in Roblox Studio. You can disable it on Settings/World. You can also disable jumping with a Humanoid Script on GUI!

7 Likes

Thank you fam. Worked like a treat.

1 Like

Hello, I would just like to add that for it to work for me, I had to set UseJumpPower to true. Add this to your code if it doesn’t work.
humanoid.UseJumpPower = true

8 Likes

Going to ask, is this for Localscript or Script as a serverscript?

1 Like

Must be a Script in ServerScriptService for security reason.

local Part = game.Workspace:WaitForChild("Part")

Part.Touched:Connect(function(otherPart)
   local humanoid = otherPart.Parent:FindFirstChild("Humanoid")
   if humanoid then
      humanoid.JumpPower = 0
   else
      return
end)

Was looking for a jump power alternative. Thank you!

script.Parent.Touched:Connect(function(h)
local d = h.Parent:FindFirstChild("Humanoid")
if d then
d.JumpPower = 0
end
end)
1 Like

this fixed my issue I was stuck for like 15 minutes wondering why it wouldn’t work, never heard of this thank you

2 Likes