Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to disable jumping in an area ?

Asked by 5 years ago
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?

0
Maybe you could try using Region3? I always use it for this sort of stuff Theroofypidgeot 21 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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)

0
It might show error while using the '', so, just replace it with "" instead. XxBORNTOHACKxX 3 — 5y
Ad

Answer this question