I’m trying to make the temperature system that rises up or cools down, but it doesn’t work.
The script used to rise the temperature:
local Temperature = game.ReplicatedStorage.ReactorSystems.Temperature
local function temperature_rise()
local temp = math.floor(Temperature.Value)
temp = temp + 5
end
while task.wait(1) do
temperature_rise()
end
If you’re changing the value, you’ll always have to apply the final change to Temperature.Value.
local Temperature = game.ReplicatedStorage.ReactorSystems.Temperature
local function temperature_rise()
local temp = math.floor(Temperature.Value)
Temperature.Value = temp + 5
end
while task.wait(1) do
temperature_rise()
end