How should I make a jump pad that boosts you into the air and the part that you touched that boosts you into the air won’t work for another 10 seconds.
I made this script
local debounce = false
script.Parent.Touched:Connect(function()
if not debounce then debounce = true
script.Parent.Velocity = script.Parent.CFrame.UpVector * 100
wait(0)
script.Parent.Velocity = script.Parent.CFrame.UpVector * 0
wait(10)
debounce = false
end
end)
is there a better way to organize this script? Like using a different method?
It doesn’t work for some reason. It only works once then does not work again. Its velocity also changes when I dont want it to. Its like a randomized jump pad basically in my own words. AlSo thats the other part. How do I set how high it goes and it keeps keeping the height it goes to instead of going up 10 studs then 9 then 8 and so on.
Why not just obtain the Humanoid of the Character that touched the Part in the first place? Not sure why you’re using the Velocity property of a BasePart, as that’s deprecated
local DB = false
local Part = script.Parent
local function Touched(Hit)
local Hum = Hit.Parent:FindFirstChild("Humanoid")
if not DB and Hum then
DB = true
Hum.JumpPower = 75 --The Default JumpPower for a Humanoid is 50
Hum.Jump = true
wait(10)
DB = false
Hum.JumpPower = 50
end
end
Part.Touched:Connect(Touched)
local DB = false
local Part = script.Parent
local function Touched(Hit)
local Hum = Hit.Parent:FindFirstChild("Humanoid")
if not DB and Hum then
DB = true
Hum.JumpPower = 75 --The Default JumpPower for a Humanoid is 50
wait(10)
DB = false
Hum.JumpPower = true
end
end
Part.Touched:Connect(Touched)
I re-edited the script, it should make the Character who touches it automatically jump (Not simultaneously though) and have an increased Jump Boost for 10 seconds
Sorry, I should worded myself better. There is no :Jump() function in the humanoid, you should use your original solution of setting Jump to true. I meant to say that it’s like calling :Jump() as an example