FearlessStudios

setWeather

Server export to set weather

setWeather

Sets the current weather and syncs clients. Uses Config.WeatherTransitionSeconds unless instant is true. Supports all weather types listed in Configure.

Manual changes still work while weather is frozen; upcoming forecasts remain empty until unfreezing. This export does not disable pattern mode. Call setPatternMode(false) first if you want to stop a sequence.

Usage

server.lua
local ok = exports["FS-Weather"]:setWeather("RAIN") -- Fade
-- exports["FS-Weather"]:setWeather("RAIN", true) -- Instant

Parameters

Prop

Type

Returns

  • boolean: True when the weather type is valid and the state was updated.