What is supposed to happen here is, you press one button, something happens to all these values. Press two, that effect is greater, and press all three, that is the greatest the effect can get.
My code: (This is placed inside the reactor)
local Temperature = script.Parent.Temperature
local Pressure = script.Parent.Pressure
local rodsUpIn = script.Parent.RodsUpIn
local rodsMidIn = script.Parent.RodsMidIn
local rodsDownIn = script.Parent.RodsDownIn
if rodsUpIn.Value == true and rodsMidIn.Value == true and rodsDownIn.Value == true then
local increaseTemp = Temperature.Value/100
local waitTime = math.random(4, 10)
for Temperature = 0, increaseTemp do
Temperature.Value = Temperature.Value + increaseTemp
wait(waitTime)
end
local increasePressure = Pressure.Value/100
for Pressure = 0, increasePressure do
Pressure.Value = Pressure.Value + increasePressure
end
elseif rodsUpIn.Value == true and rodsMidIn.Value == true or rodsUpIn.Value == true and rodsDownIn.Value == true or rodsMidIn.Value == true and rodsMidIn.Value == true then
local increaseTemp = Temperature.Value/150
local waitTime = math.random(4, 10)
for Temperature = 0, increaseTemp do
Temperature.Value = Temperature.Value + increaseTemp
wait(waitTime)
end
local increasePressure = Pressure.Value/150
for Pressure = 0, increasePressure do
Pressure.Value = Pressure.Value + increasePressure
end
elseif rodsUpIn.Value == true or rodsMidIn.Value == true or rodsDownIn.Value == true then
local increaseTemp = Temperature.Value/200
local waitTime = math.random(4, 10)
for Temperature = 0, increaseTemp do
Temperature.Value = Temperature.Value + increaseTemp
wait(waitTime)
end
local increasePressure = Pressure.Value/200
for Pressure = 0, increasePressure do
Pressure.Value = Pressure.Value + increasePressure
end
end```
local Temperature = script.Parent.Temperature
local Pressure = script.Parent.Pressure
local rodsUpIn = script.Parent.RodsUpIn
local rodsMidIn = script.Parent.RodsMidIn
local rodsDownIn = script.Parent.RodsDownIn
local waitTime = math.random(4, 10)
if rodsUpIn.Value and rodsMidIn.Value and rodsDownIn.Value then
local increaseTemp = Temperature.Value/100
for _ = 0, increaseTemp do
Temperature.Value += increaseTemp
task.wait(waitTime)
end
local increasePressure = Pressure.Value/100
for _ = 0, increasePressure do
Pressure.Value += increasePressure
end
elseif rodsUpIn.Value and rodsMidIn.Value or rodsUpIn.Value and rodsDownIn.Value or rodsMidIn.Value and rodsMidIn.Value then
local increaseTemp = Temperature.Value/150
for _ = 0, increaseTemp do
Temperature.Value += increaseTemp
task.wait(waitTime)
end
local increasePressure = Pressure.Value/150
for _ = 0, increasePressure do
Pressure.Value = increasePressure
end
elseif rodsUpIn.Value or rodsMidIn.Value or rodsDownIn.Value then
local increaseTemp = Temperature.Value/200
for _ = 0, increaseTemp do
Temperature.Value += increaseTemp
task.wait(waitTime)
end
local increasePressure = Pressure.Value/200
for _ = 0, increasePressure do
Pressure.Value += increasePressure
end
end
E.g. (in my opinion) if all values are true, you could get into 1st and last elseif case.
I don’t know how Roblox/LUA handles this, probably it ignores both.