A full weather sync system for your server utilizing statebags for everything. Smooth, modern UI designed and made by myself (open to edit), configurable chance based weather cycles. Supports popular.
YOU MAY NEED TO manually ensure randol_weather in your server.cfg before other scripts otherwise you may error out.
Client
-- Can be used across client scripts to toggle weather sync.
exports.randol_weather:ToggleSync(boolean) -- true or false
-- Gets triggered when time changes. Good as a listener to handle third party resources.
AddEventHandler('randol_weather:client:onTimeChange', function(data)
-- print(data.hours, data.minutes)
end)
Server
-- List of all global states used to manage sync.
GlobalState.CURRENT_WEATHER
GlobalState.CURRENT_TIME (GlobalState.CURRENT_TIME.hours, GlobalState.CURRENT_TIME.minutes)
GlobalState.BLACKOUT_STATE,
GlobalState.WEATHER_FROZEN,
GlobalState.TIME_FROZEN
-- Some exports if you're unfamiliar with global states.
exports.randol_weather:SetWeather(weather) -- string 'THUNDER' as an example
exports.randol_weather:SetTime(hours, minutes) -- number: 12, 15
exports.randol_weather:ToggleBlackout(boolean) -- boolean: true or false
-- Gets triggered when time changes. Used as a listener in third party resources.
AddEventHandler('randol_weather:server:onTimeChange', function(data)
-- print(data.hours, data.minutes)
end)