#Consistent Trampoline

1 messages · Page 1 of 1 (latest)

strong heron
#

I'm trying to make a script for a part to make the player bounce the exact same height no matter if they walk onto it or jump onto it, but every example I've found has varying heights. How can I make a script so the bounce height is guaranteed to be the same all the time? (I don't want jump height affected, the player shouldn't need to press space to jump to trigger the bounce it should just always bounce on contact)

Best I could come up with is AssemblyLinearVelocity but again, not consistent

misty finch
#

and set the .jump property to true

strong heron
#

oh so it forces them to jump automatically wihtout pressing space, so it'd have the exact same effect?

strong heron
#

how did i miss that lol, illt ry it out\

#

i might be dumb but the jump height isn't changing, but it is triggering the jump:

local jumpMultiplier = 100
local debounce = false

part.Touched:Connect(function(hit)
    if debounce then return end
    
    local humanoid = hit.Parent:FindFirstChild("Humanoid")
    if humanoid then
        debounce = true
        local original = humanoid.JumpPower
        humanoid.JumpPower = original * jumpMultiplier
        wait()
        humanoid.Jump = true
        wait(0.5)
        debounce = false
    end
end)
#

it's in a server script directly under the trampoline part btw

strong heron
#

ah. it's JumpHeight, not JumpPower, i see i see
yeah i got it woorking, cheers

stiff halo
#

task.wait is just better

strong heron
#

is there ever a scenario where wait() should be used over task.wait()?

stiff halo
#

wait() is old and inaccurate

strong heron
#

gotcha