game.Workspace.WATER.Touched:connect(function(hit)
wait(2)
hit = game.Players:GetPlayerFromCharacter(hit.Parent)
game.Players:FindFirstChild(hit).Oxygen.Value = game.Players:FindFirstChild(hit).Oxygen.Value - 2
end)
Basically the player has a numbervalue called oxygen and I want to make it so while the player is touching water the value has 2 subtracted every 2 seconds but this script doesn't work the error I get is 16:34:25.714 - Workspace.WATER.Script:3: attempt to index a nil value

1 comment
name 'hit' something else, you have 2 things named 'hit'