๐ŸŒค๏ธqb-weathersync

Could someone please turn off the rain?

Introduction

  • Handles the logic for changing and syncing the weather

  • Ability to set weather sync/desync weather

  • Use exports to call weather changing events to any resource

Configuration

General

Config                  = {}
Config.DynamicWeather   = true -- set this to false if you don't want the weather to change automatically every 10 minutes.

-- On server start
Config.StartWeather     = 'EXTRASUNNY' -- default weather
Config.BaseTime         = 8 -- time     
Config.TimeOffset       = 0 -- time offset 
Config.FreezeTime       = false -- freeze time 
Config.Blackout         = false -- set blackout                                 
Config.BlackoutVehicle  = false -- set blackout affects vehicles                
Config.NewWeatherTimer  = 10 -- time (in minutes) between each weather change   
Config.Disabled         = false -- set weather disabled                         

Weather types

Exports

nextWeatherStage

Triggers event to switch weather to next stage

Lua example

JavaScript example

setWeather [type]

Switch to a specified weather type from Config.AvailableWeatherTypes

Lua example

JavaScript example

setTime [hour] (minute)

Sets sun position based on time to specified

Lua example

JavaScript example

setBlackout (true|false)

Sets or toggles blackout state and returns the state

Lua example

JavaScript example

setTimeFreeze (true|false)

Sets or toggles time freeze state and returns the state

Lua example

JavaScript example

setDynamicWeather (true|false)

Sets or toggles dynamic weather state and returns the state

Lua example

JavaScript example

getBlackoutState

Returns if blackout is enabled or disabled

Lua example

JavaScript example

getTimeFreezeState

Returns if time progression is enabled or disabled

Lua example

JavaScript example

getWeatherState

Returns the current weather type

Lua example

JavaScript example

getDynamicWeather

Returns if time progression is enabled or disabled

Lua Example

JavaScript example

Events

RequestStateSync

RequestCommands

setWeather

setTime

toggleBlackout

toggleFreezeTime

toggleDynamicWeather

Commands

/freezetime - Toggle time progression

/freezeweather - Toggle dynamic weather

/weather [type] - Set weather

/blackout - Toggle blackout

/morning - Set time to 9am

/noon - Set time to 12pm

/evening - Set time to 6pm

/night - Set time to 11pm

/time [hour] (minute) - Set time to whatever you want

Last updated

Was this helpful?