Happy to help!
Just FYI, the reason it is printing while in the air, is because you are raycasting downwards without taking into account if the player is on the ground of not.
To fix this, add the FloorMaterial check into the if statement.
if Material ~= Enum.Material.Water and Material ~= Enum.Material.Air and Player.Character.Humanoid.FloorMaterial ~= Enum.Material.Air then