How to remove this delay on my jumppad?

Hello, I do not have much knowlege with scripting but have this I did this jumppad.
The jumppad has a delay on jumping tho and I tried much to fix it but nothing worked so does anyone here know why there is a delay and how to fix it?


pad = script.Parent

function jump(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		local humanoid = hit.Parent:FindFirstChild("Humanoid")
		humanoid.JumpHeight = 25
		humanoid.Jump = true
		humanoid.JumpHeight = 7.2


Touched has always had a small delay, the way to get around that is people usually use raycast or magnitude. That being said your script would probably work a lot better if it was cleaned up a bit.

	if hit.Parent:FindFirstChild('Humanoid') then
		local hum = hit.Parent.Humanoid
		hum.JumpHeight = 25
		hum.Jump = true
		hum.JumpHeight = 7.2

Try this out.

I tested that script out. It has less delay than before but it still has delays sometimes and sometimes not. Thank you tho.

I had the same problem in my chart. I solved it by putting an invisible part above the jumppad, which triggers the touched event sooner.

Oh yeah that works better. Thank you very much