local function doRandomWeather() math.randomseed(os.time()) math.random(); --?? math.random(); math.random(); --?? local w=ScenEdit_GetWeather(); local c=math.random(1,3); local newtemp; local newrain; local newcloud; local newstate; if c==1 then print('doing c1') newtemp=tonumber(w.temp) - math.random(3,8); newrain=tonumber(w.rainfall) + math.random(10,30); newcloud=tonumber(w.undercloud) + math.random(1,3) newstate=tonumber(w.seastate)+math.random(1,3) if newrain > 50 then newrain = 50; end if newcloud > 1 then newcloud = 1; end if newstate > 9 then newstate = 9; end elseif c==2 then print('doing c2') newtemp=tonumber(w.temp) + math.random(3,8) newrain=tonumber(w.rainfall) - math.random(10,30) newcloud=tonumber(w.undercloud) - math.random(1,3) newstate=tonumber(w.seastate)-math.random(1,3) if newrain < 0 then newrain = 0; end if newcloud < 0 then newcloud=0; end if newstate < 0 then newstate=0; end else print('doing c3') return; end ScenEdit_SetWeather(newtemp, newrain, newcloud, newstate) end doRandomWeather();