How do I disable jumping for the player upon touching an object?
You can also try disabling the jump state
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)
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!
Thank you fam. Worked like a treat.
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
Going to ask, is this for Localscript or Script as a serverscript?
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)
this fixed my issue I was stuck for like 15 minutes wondering why it wouldn’t work, never heard of this thank you