basically, I'm making an underwater game where you need to go underwater find treasuer and other stuff. but I don't want them to stay under all the time. I want a bar that tells them how much air they have left and when it hits 0 they lose health you gain air when you are out of the water and loses it when your underwater
-- I think the code might be something like editing the bar size
bar_one = script.parent.WaitForChid("BarOne")
if == .............. do
bar_one --size decrease
else
bar_one --size increase
end
I'm not sure if that's on the right lines using a terrain water to make it look realistic

4 comments
Are you using terrain water or a block with cancollide off?
terrain
Just make a for loop and for every -1 then the bar drops a certain amount, and when the for loop = 0 the player starts taking damage.
http://wiki.roblox.com/index.php?title=Loops