Skip to main content

Gameplay::setWeatherTypeOverTime

This function transitions the weather from one weather type to another over the specified amount of time <u>in seconds</u>.

For example, it is now EXTRASUNNY. The weather is now transitioning to THUNDER over 60 minutes. Rain will slowly start and clouds will slowly form over the time of 1 hour, rather than it being instant like [World::weather](/world-weather)

You only have to specify the <i>new</i> weather.

Syntax

```js mp.game.gameplay.setWeatherTypeOverTime(weatherType, time); ```

Required Arguments

  • weatherType: String
  • time: float

Return value

  • Undefined

Example

This example will call the client-side event 'transitionWeather' for the every player, to synchronise the weather. This gradually transitions the weather over x seconds, <u>not milliseconds</u>.

See also