What you have there will make it pick a random time, and then after that time change the weather. After that same time, change the weather again, etc… For example, it picks three minutes as the delay. After every three minutes, the weather changes.
If you wanted it to change the weather and reset the random delay each time (like after three minutes change weather, and then it switches to after 4.5 minutes change the weather and then 2 minutes), you could try something like this:
[lua]local mRan = math.random
local function changeWeather()
–Add a randomizer for what to change it to
–Still in the weather function:
if (weatherTimer) then
timer.cancel(weatherTimer)
local ranDelay = mRan(60,300)*1000
weatherTimer=timer.performWithDelay(randDelay, changeWeather) – Will set another random delay each time
end
end
changeWeather() – Begin the weather changing and timers[/lua]
[import]uid: 147322 topic_id: 29122 reply_id: 117165[/import]