I'm trying to make a Gui where when you're underwater you have a air meter that slowly goes down. Right now I'm just trying to make a working status bar, but it's not working. When the air value gets to 0 it's supposed to stop but it keeps going, making the Gui go out of it's frame. (Like negative numbers)
air = 1
while wait(.1) do
air = air - 0.01
script.Parent.Size = UDim2.new(air , 0 , 1 , 0)
if air == 0 then break
end
end
Also, this script is located like this: ScreenGui > Frame > Text Label > Script

1 comment
Thanks, worked like a charm.