Somewhat buggy jumpad, how do i improve it?

the jumpad works fine but sometimes when using it my characters jumps and shortly after jumping i “bump” on something and fall down.

local tramp = script.Parent
local debounce = false
local x = tramp.Size.X
local z = tramp.Size.Z
local y = tramp.Size.Y

function OnTouched(plr)
	if debounce == false then
		debounce = true
		local p = plr.Parent:FindFirstChild("Humanoid")
		if p ~= nil then
			script.Bounce:Play()
			for i = 0, 3.2, 0.3 do
				wait(0)
				tramp.Size = Vector3.new(i, y, z)
			end
			wait(2)
			for v = 3.2, 0, -0.3 do
				wait(0)
				tramp.Size = Vector3.new(v, y, z)
			end
			debounce = false
		end
	end
end

function OnFling(plr)
	if debounce == false then
		local l = plr.Parent:FindFirstChild("Humanoid")
		if l ~= nil then
			tramp.Velocity = Vector3.new(0,500,0)
			wait(0.3)
			tramp.Velocity = Vector3.new(0,0,0)
		end
	end
end

tramp.Touched:Connect(OnTouched)
tramp.Touched:Connect(OnFling)

Your jump pad is perfectly fine! This is what’s causing the “bump”. Try removing that and play it

the reason i added that is because i want it to have a cooldown, right after the second path of the ontouched function is played.

This will remove the so called “Bump”

local y = tramp.Size.Y
local cooldown = 0.3

function OnTouched(plr)
	if debounce == false then
		debounce = true
		local p = plr.Parent:FindFirstChild("Humanoid")
		if p ~= nil then
			script.Bounce:Play()
			for i = 0, 3.2, 0.3 do
				wait(0)
				tramp.Size = Vector3.new(i, y, z)
			end
			wait(2)
			for v = 3.2, 0, -0.3 do
				wait(0)
				tramp.Size = Vector3.new(v, y, z)
			end
			debounce = false
		end
	end
end

function OnFling(plr)
	if debounce == false then
		local l = plr.Parent:FindFirstChild("Humanoid")
		if l ~= nil then
			tramp.Velocity = Vector3.new(0,500,0)
			wait(cooldown)
		end
	end
end

tramp.Touched:Connect(OnTouched)
tramp.Touched:Connect(OnFling)

If this doesn’t work, you know where to find me.