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)
