function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then
h.Health = h.Health -20
wait(2.00)
end
end
script.Parent.Touched:connect(onTouched)
So far I cant find out how to make it that you take damage while your jumping instead of having it where you take damage while your just walking which would be unrealistic in a game Im developing for but not doing much scripting unless my friend needs it. Can't figure it out any suggestions?

2 comments
couldn't you use if Humanoid.HumanoidStateType == Enum.HumanoidStateType.Jumping then?
It didn't end up working, still tryna find the solution although I knew it a lil with older roblox code. gg roblox updates gg.