(SOLVED) How to enable or disable jump in certain part?

Hello, I’m having a problem writing a script that will turn on or off players jumping when they’re in a part.
but when he leaves the part, his jump will return to what it was before entering the part.

I checked a lot of websites to find a solution to create this script but didn’t find anything about it.

(a script for people who don’t know how to do this, and don’t forget to enable CharactherUseJumpPower in the StarterPlayer)

local Part1 = game.Workspace:WaitForChild("Part1")
local Part2 = game.Workspace:WaitForChild("Part2")

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

Part2.Touched:Connect(function(otherPart)
	local humanoid = otherPart.Parent:FindFirstChild("Humanoid")
	if humanoid then
		humanoid.JumpPower = 50
	end
end)

I don’t quite know what you mean exactly, but if I understood you correctly, the .Touched() and .TouchEnded() events could help you with your problem.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.