getRainLevel | Multi Theft Auto: Wiki Skip to content

getRainLevel

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function is used to get the current rain level.

Note

The function will return false server-side if rain level has not been set before the function is called.

Syntax

getRainLevel ( )

Code Examples

server

Example:Sets the rain (So it can detect it) before returning it. (In this case, when resource starts.)

addEventHandler("onClientResourceStart", resourceRoot, function()
setRainLevel(math.random(5))
end)
function returnRain()
local rain = getRainlevel()
if(rain >= 1) then
outputChatBox("Looks like it's going to be a rainy day!",255,130,130,false)
else
outputChatBox("Surprisingly dry!",255,130,130,false)
end
end
addCommandHandler("rain", returnRain)

See Also

World Functions