GetWeather

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search

getWeather

Returns the canonical name of the server's authoritative weather state.

Syntax

string weather = getWeather()

Parameters

This function does not accept parameters.

Returns

Returns one of sunny, cloudy, rain1, rain2, or rain3.

Examples

Report the current weather to a player:

addCommandHandler("weather", function(playerId)
    outputChatBox("Current weather: " .. getWeather(), playerId)
end)

Notes

  • Available only in server-side resource scripts.
  • The returned value is server state, not a direct read from one client's renderer.