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)