MiscClient

getRandomIntInRange

GET_RANDOM_INT_IN_RANGE0xD53343AA4FB7DD28

The GTA V native GET_RANDOM_INT_IN_RANGE of the MISC namespace, as LS:MP client scripts call it: the global function getRandomIntInRange, in JavaScript and in Lua.

SignatureJavaScript
getRandomIntInRange(startRange: number, endRange: number): number
SignatureLua
getRandomIntInRange(startRange: integer, endRange: integer): integer

Usage

JavaScript
const result = getRandomIntInRange(startRange, endRange);
Lua
local result = getRandomIntInRange(startRange, endRange)

Parameters

ParameterTypeJavaScriptLua
startRangeintnumberinteger
endRangeintnumberinteger

Returns

int JavaScript number, Lua integer

Reference

Namespace
Misc MISC
In the game
int GET_RANDOM_INT_IN_RANGE(int startRange, int endRange)
Hash
0xD53343AA4FB7DD28

Open in the interactive natives reference