Why doesnt my water detecting script work

i want to make a script that changes players speed to 10 when hes in the water, but it doesnt work for some reason.

heres the script and an image

local hum = script.Parent:WaitForChild("Humanoid")
hum.Changed:Connect(function()
	if hum.FloorMaterial ~= nil then
		print("player not in the water")
		hum.WalkSpeed = 20
	elseif hum.FloorMaterial == nil then
		print("player in the water")
		hum.Walkspeed = 10
	end
end)

ah i see the issue, it says nil in the properties but in fact its Air.