These scripts work in Studio, not in game.
local trampoline = script.Parent
trampoline.Velocity = Vector3.new(0,100,0)
function onTouch(hit)
wait(0.000001)
if hit.Parent:FindFirstChild("Humanoid") then
local i = 1
while i < 10 do
hit.Parent:FindFirstChild("Humanoid").Jump = true
wait(0.001)
end
end
end
script.Parent.Touched:connect(onTouch)
Line 1 and Line 2 make the trampoline bounce you. However if you do not hold down the jump button then the trampoline bounces you repeatedly about 5 studs into the air really fast (basically it breaks and glitches). Therefore I made a script that makes you jump and it makes the trampoline work beautifully, but the jump script only works in studio and not in game.
function onTouch(hit)
wait(0.1)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Torso.Velocity = Vector3.new(0,100,0)
wait(0.1)
end
end
script.Parent.Touched:connect(onTouch)
Alternatively this script above works and does not need the jump script and works fine in studio but is completely broken in game. I'm not so much looking for a method to fix this if there isn't one but a new method of making a Trampoline if mine are incorrect, sorry for being long winded I was just wanted to be clear and precise, any help is greatly appreciated.P.S. I've looked at many trampoline free models and they all are broken if not buggy to the least when I test them in game. Thank you.

2 comments
Thank you for making this it works great although the problem is that the trampoline glitches your jump if you don't hold down spacebar to jump before you land and this is what I was trying to get rid of and it still occurs in this script. However I made a automatic jump script which makes you jump and removes this glitch although the jump script works in studio and breaks in game. Futhermore the
2nd script in this question works like a charm in studio with no glitch what so ever but breaks in game. I appreciate the answer and the effort but it hasn't gotten us any further, what we really need is a fix for why the only work in Studio if you could because we are noobs xD. If your not sure don't stress it, I appreciate the help very much, thank you.