This is something I made a while back and it used to work. Basically the premise of it is you step on the part and you get jump boost for a second. I was just testing out debounces since I was just learning them. Now, when I step on the part, it just doesn’t work. If you guys can help me that’ll be appreciated.
local Part = script.Parent
local onTouched = false
Part.Touched:Connect(function(onHit)
if not onTouched then
onTouched = true
if onHit.Parent then
hum = onHit.Parent:FindFirstChild("Humanoid")
hum.JumpPower = 150
wait(1)
hum.JumpPower = 50
end
wait(3)
onTouched = false
end
end)
I’ve already dealt with this before. If you check the humanoid, it apparently uses “JumpHeight” instead of JumpPower, and there’s a setting to make it use JumpPower instead of JumpHeight.
Just use
local Part = script.Parent
local onTouched = false
Part.Touched:Connect(function(onHit)
if not onTouched then
onTouched = true
if onHit.Parent:FindFirstChild("Humanoid") then --Confirms it is a character
local hum = onHit.Parent:FindFirstChild("Humanoid")
hum.UseJumpPower = true
hum.JumpPower = 150
wait(1)
hum.JumpPower = 50
end
wait(3)
onTouched = false
end
end)
Stupid roblox settings. : |
Also. Beautiful debounce. :).
3 Likes
Aight thanks man, I appreciate it.
1 Like
It still doesn’t work? My problem is not jump power. Idk whats happening.
Can you put prints throughout the script?
I tested it on my game, and it works fine.
Add a local to the humanoid variable.
nvm now it works lmao. Thanks for the help.
Yeah I just added local lol. The “hum” was underlined in blue so yeah.
1 Like