Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to make a part that makes you repeatedly bounce?

Asked by 3 years ago

So i've been trying to make a part that when touched it makes you jump [Jumpower 100] all the time until you stop touching. Here is my script so far [Not repeatdly, just normal jump pad script]

script.Parent.Touched:Connect(function(hit)
    local humanoid = hit.Parent:FindFirstChild("Humanoid")
    humanoid.JumpPower = 100
end)

script.Parent.TouchEnded:Connect(function(hit)
    local humanoid = hit.Parent:FindFirstChild("Humanoid")
    humanoid.JumpPower = 50
end)

If you could help me on doing that that'd be great.

P.S) with the normal script i'm doing when you first touch the part and jump it gives you the jump power but when you land in the part again the jumpower is glitchy and it changes between the regular jumpower and 100 so fast so it doesn't work. How can I fix that as well?

2 answers

Log in to vote
0
Answered by 3 years ago

The answer above is pretty complex. All you have to do is:

part.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid) then
        hit.Parent.Humanoid.JumpPower = 100
        hit.Parent.Humanoid.Jump = true
        hit.Parent.Humanoid.JumpPower = 50 --Resets jump power
    end
end)
0
line 3 has an error with the quotes for the findfirstchild by the way. That was just a typo Dr_Smartypants123 86 — 3y
0
Line 2 ("Humanoid") not ("Humanoid) FLIPPER4440 21 — 3y
0
yes, sorry, typos Dr_Smartypants123 86 — 3y
0
This is what I asked for, makes you repeatedly bounce even if you don't want to bounce , tysm! Nitrolux200 62 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

I believe you don't need to script, unless I'm thinking of the wrong idea. All you have to do that I've thought of is anchor the object, then set the velocity property of the object to 0, 100(or more, or less), 0.

Answer this question