The script I had made, I thought would take oxygen on contact with Roblox water. Except it does not, turns out if you just walk in, it will not recognized the humanoid is swimming until they jump. I was curious if there was a more effective way to detect if a player is swimming in water than what I have for code. Any help will be appreciated.
--Code Removed, problem solved.
Thank you.
Alright, I did some experimenting. I used the .Swimming event and that seems to pick up that a person is in the water and is swimming. It now picks up that a player made contact with the water, probably should have experimented on that event rather than just relying on the data I had the script print in the output to begin with. The original code was using StateChanged which would not pick up a person swimming immediately.
Line 31's oxygen is lowercase and it's not defined anywhere.
The uppercase "Oxygen" is an object, I see that now.