Hello there! I am trying to make my code more efficient, and I would like to make my facility alarms accommodate more than one scenario. For the facility, I have 2 scenarios: A freezedown and a meltdown. They are both triggered by a value which changes to a certain temperature. I currently have an issue where I have to make separate alarms for each scenario. I would like to make each alarm capable of turning red when the temperature value is equal to or more than 4500, and turning blue when the temperature reaches -1010. Screenshots are attached and code is also attached.
In the past, when I tried to do this, the system only checked for the 4500 to turn red and NOT the -1010 to turn blue. The code is controlled by a value at: game.Workspace.CoreScenario["Core Temperature"]
.
while true do wait()
if game.Workspace.CoreScenario["Core Temperature"].Value >= 4500 then
script.Parent.PrimaryPart = script.Parent.Main
script.Parent:SetPrimaryPartCFrame(script.Parent.Main.CFrame *
CFrame.fromEulerAnglesXYZ(0.05, 0, 0))
script.Parent.Spin.a.Brightness = 55
script.Parent.Spin.b.Brightness = 55
else
script.Parent.PrimaryPart = script.Parent.Main
script.Parent:SetPrimaryPartCFrame(script.Parent.Main.CFrame * CFrame.fromEulerAnglesXYZ(0, 0, 0))
script.Parent.Spin.a.Brightness = 0
script.Parent.Spin.b.Brightness = 0
end
end