Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Anyone know how to make an air bar for an underwater game? Thanks in advance!

Asked by 6 years ago
Edited 6 years ago

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

0
Are you using terrain water or a block with cancollide off? cmgtotalyawesome 1418 — 6y
0
terrain EpicAshtonTheBoy 33 — 6y
0
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. GottaHaveAFunTime 218 — 6y

Answer this question