So the problem is, if I implement the Meltdown Code I know it's going to constantly run infinitely, and I don't want that. So how can I make it only run once, while I have a while loop present?
coretemp = script.Parent.coretemp
heatmult = script.Parent.heatmult
coolmult = script.Parent.coolmult
coretemp.Value = 2000 -- Starting Core Temperature
heatmult.Value = 1 -- Starting heat multiplier
coolmult.Value = 0 -- Starting cool multiplier
corestatus = "SAFE"
function heatgeneration()
wait(1)
if heatmult.Value > coolmult.Value then
coretemp.Value = coretemp.Value + 1 * heatmult.Value
elseif coolmult.Value > heatmult.Value then
coretemp.Value = coretemp.Value - 1 * coolmult.Value
end
end
function status()
if heatmult.Value ~= coolmult.Value then
heatgeneration()
end
script.Parent.Name = "Core Temp: "..coretemp.Value.."c, "..corestatus
print(script.Parent.Name)
if coretemp.Value >= 8999 then
corestatus = "DANGER"
else
corestatus = "SAFE"
end
if corestatus == "DANGER" then
script.Parent.Core.Size = Vector3.new(15.75,15.75,15.75)
script.Parent.Shield.Size = Vector3.new(16,16,16)
else
script.Parent.Core.Size = Vector3.new(3.75,3.75,3.75)
script.Parent.Shield.Size = Vector3.new(4,4,4)
end
end
while wait() do
status()
end

1 comment
This script is the code of a Nuclear Reactor I am building.