marty000123 Posted March 31, 2017 Share Posted March 31, 2017 (edited) weather = {1, 8, 9, 19} function table.random ( theTable ) return theTable[math.random ( #theTable )] end function randomWeather() setTimer ( function() setWeather(table.random(weather)) end, 600000, 0 ) end The weather doesn't change, why? Edited March 31, 2017 by marty000123 Link to comment
NeXuS™ Posted March 31, 2017 Share Posted March 31, 2017 weather = {1, 8, 9, 19} function table.random ( theTable ) return theTable[math.random ( #theTable )] end function randomWeather() setTimer ( function() setWeather(table.random(weather)) end, 600000, 0 ) end Btw. Next time use <> tags. Spoiler Link to comment
marty000123 Posted March 31, 2017 Author Share Posted March 31, 2017 Thanks for the quick response, but the weather still doesn't change. Link to comment
NeXuS™ Posted March 31, 2017 Share Posted March 31, 2017 Is it getting called? function randomWeather() setTimer ( function() setWeather(table.random(weather)) end, 1000, 0 ) end randomWeather() Link to comment
marty000123 Posted March 31, 2017 Author Share Posted March 31, 2017 I don't know why but it works, thanks!!! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now