TmpChng (line 63.) is supposed to be responsible for the changing of the temperature either up or down based on the value "CoolantActive" being true or false.
So far it works right, when it lowers to 300 it stops which is as low as I want it to go, but when its going up is the problem.
It keeps getting stuck at 499.
Any idea why?
local Coolant = script.Parent.GUIS.Coolant.SurfaceGui:WaitForChild("TextBox") local Status = script.Parent.GUIS.Status.SurfaceGui:WaitForChild("TextBox") local Temp = script.Parent.GUIS.Temp.SurfaceGui:WaitForChild("TextBox") local TempValue = script.Parent.VALUES:WaitForChild("Temp") local Meltdown = script.Parent.VALUES:WaitForChild("MeltdownStatus") local SelfDestruct = script.Parent.VALUES:WaitForChild("SelfDestruct") local CoolantActive = script.Parent.VALUES:WaitForChild("CoolantActive") function Melt() Coolant.Text = "MELTDOWN" Coolant.TextColor3 = Color3.fromRGB(255,0,0) Status.Text = "MELTDOWN" Status.TextColor3 = Color3.fromRGB(255,0,0) Temp.Text = "MELTDOWN" Temp.TextColor3 = Color3.fromRGB(255,0,0) end function MeltImminent() Coolant.Text = "MELTDOWN IMMINENT" Coolant.TextColor3 = Color3.fromRGB(255,0,0) Status.Text = "MELTDOWN IMMINENT" Status.TextColor3 = Color3.fromRGB(255,0,0) Temp.TextColor3 = Color3.fromRGB(255,0,0) end function OvHeat() Status.Text = "OVERHEAT" Status.TextColor3 = Color3.fromRGB(198,150,55) Temp.TextColor3 = Color3.fromRGB(198,150,55) end function PwrSts() Status.Text = "Generating Power" Status.TextColor3 = Color3.fromRGB(69,255,137) end function Destruct() Coolant.Text = "SELF DESTRUCT" Coolant.TextColor3 = Color3.fromRGB(255,0,0) Status.Text = "SELF DESTRUCT" Status.TextColor3 = Color3.fromRGB(255,0,0) Temp.Text = "SELF DESTRUCT" Temp.TextColor3 = Color3.fromRGB(255,0,0) end function CoolantSts() if CoolantActive.Value == true then Coolant.Text = "Coolant Active" Coolant.TextColor3 = Color3.fromRGB(69,255,137) elseif CoolantActive.Value == false then Coolant.Text = "Coolant Disabled" Coolant.TextColor3 = Color3.fromRGB(255,0,0) end end function UpdTemp() Temp.Text = TempValue.Value Temp.TextColor3 = Color3.fromRGB(69,255,137) end function TmpChng() if CoolantActive.Value == true and TempValue.Value >= 301 then wait(.2) TempValue.Value = TempValue.Value - 1 elseif CoolantActive.Value == false and TempValue.Value >= 301 then wait(.2) TempValue.Value = TempValue.Value + 1 end end while true do if Meltdown.Value == false and SelfDestruct.Value == false and TempValue.Value <= 499 then wait() TmpChng() UpdTemp() PwrSts() CoolantSts() elseif Meltdown.Value == false and SelfDestruct.Value == false and TempValue.Value >= 500 and TempValue.Value <= 799 then wait() TmpChng() OvHeat() CoolantSts() elseif Meltdown.Value == false and SelfDestruct.Value == false and TempValue.Value >= 800 and TempValue.Value <= 999 then wait() MeltImminent() elseif Meltdown.Value == false and SelfDestruct.Value == false and TempValue.Value >= 1000 then wait() Melt() end end
whats problematic about the function on line 63?
if tempValue.Value is higher than 499 u never call tempChng, so yes, it will be 'stuck' on 499