Underwater Breathing Mechanism

Hey I have been trying for weeks now to create Breathing mechanism, that when my player dives under water the breathing bar starts to decrease and when he surfaces it increases. Please Help!

The answer to the question is here. I’m marking this as resolvesd