Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to disable jumping in an area ?

script.Parent.Touched:connect(function(hit)
local h = hit.Parent:FindFirstChild('Humanoid')
if h then
h.JumpPower = 0  
end
end)

That is the code I currently have got in a brick big enough for my area. I have also had to put one as an outline around the outside to let them jump again but this was temperamental.

Is it possible to make this all happen in just the 1 script, if so how?

1 comment

0

Maybe you could try using Region3? I always use it for this sort of stuff

1 answer

Fixed with:

script.Parent.Touched:connect(function(hit) local h = hit.Parent:FindFirstChild('Humanoid') if h then h.JumpPower = 0 end end) script.Parent.TouchEnded:connect(function(hit) local h = hit.Parent:FindFirstChild('Humanoid') if h then h.JumpPower = 50 end end)

1 comment

0

It might show error while using the '', so, just replace it with "" instead.

This discussion is preserved as it was. New answers, comments, and votes are closed.