local InSpace = script.Parent:WaitForChild("InSpace")
local Oxygen = script.Parent:WaitForChild("Oxygen")
local Radiation = script.Parent:WaitForChild("Radiation")
local Total = 100
InSpace:GetPropertyChangedSignal("Value"):Connect(function()
if InSpace.Value == true then
while InSpace == true do
Oxygen.Value = Oxygen.Value - 1
print("a")
script.Parent:WaitForChild("OxygenMeter"):WaitForChild("Fill").Size = UDim2.new(1,0,(Oxygen.Value/Total),0)
wait(2)
end
end
end)
i’m trying to do an oxygen system for my game and when i try to decrease it’s value it’s stays the same and won’t change.
i don’t get any error messages and i’m trying to figure out why
this is what my gui looks like