Hello, on my new game we have a trampoline on the main map to keep people entertained. The problem is, 40% of the time the trampoline doesn’t actually make you jump.
Here is a screenshot of the issue:
We don’t exactly know what to do in order to fix this issue.
Here is our current code for the trampoline:
local toggle = false --keep at false
local config = script.Parent:FindFirstChild("Configure") --finds Configure
local thrustlife = config:FindFirstChild("ThrustLifeTime").Value --Finds thrust life time
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if not toggle then
toggle = true
local thrust = Instance.new("BodyThrust")
thrust.Force = Vector3.new(0,100,0) --PushForce
hit.Parent:FindFirstChild("Humanoid").JumpPower = config:FindFirstChild("JumpHeight").Value
hit.Parent:FindFirstChild("Humanoid").Jump = true
game.Debris:AddItem(thrust, thrustlife) --Push force life time
wait(2)
hit.Parent:FindFirstChild("Humanoid").JumpPower = 0 --dont touch
hit.Parent:FindFirstChild("Humanoid").Jump = false
toggle = false
end
end
end)
Thank you