✓ Accepted answer
Might look something like this to startout:
function Meltdown()
end
function Freezedown()
end
local MeltdownPoint = 2000
local FreezedownPoint = 2000
local updateRate = .25
local temperature = 0
local temperatureDelta = 0
while true do
wait(updateRate)
temperature = temperature + temperatureDelta
if temperature >= MeltdownPoint then
Meltdown()
elseif
Freezedown()
end
end
If you wanted to make the temperature change random it might look something like this:
function Meltdown()
end
function Freezedown()
end
local MeltdownPoint = 2000
local FreezedownPoint = 2000
local updateRate = .25
local temperature = 0
local temperatureDelta = 0
while true do
wait(updateRate)
temperatureDelta = temperatureDelta + (math.random(-3,3))
temperature = temperature + temperatureDelta
if temperature >= MeltdownPoint then
Meltdown()
elseif
Freezedown()
end
end
if this was a server script and based on player input you could have a remote events that the client fire to change the temperature delta
function Meltdown()
end
function Freezedown()
end
local MeltdownPoint = 2000
local FreezedownPoint = 2000
local updateRate = .25
local temperature = 0
local temperatureDelta = 0
while true do
wait(updateRate)
temperature = temperature + temperatureDelta
if temperature >= MeltdownPoint then
Meltdown()
elseif
Freezedown()
end
end
tempDeltaUpEvent.OnServerEvent:Connect(function()
temperatureDelta = temperatureDelta + 1
end)
tempDeltaDownEvent.OnServerEvent:Connect(function()
temperatureDelta = temperatureDelta -1
end)