Glorpia Docs
Scripting / API

Math & Task Utilities

Random numbers, coherent noise and basic timing helpers available to Glorpia Luau.

Infinity

inf

inf is the positive-infinity numeric value. Use -inf for negative infinity. Scalar number properties can use infinity when their property range permits it. Integer properties convert infinity to the corresponding integer limit.

math.random()

math.random()
math.random(max)
math.random(min, max)
NameTypeDescription
no argumentsnumberReturns a pseudo-random number from 0 up to but not including 1.
maxintegerReturns an integer from 1 through max.
min, maxintegerReturns an integer in the inclusive range.
Luau
local roll = math.random(1, 6)
print("Rolled", roll)

math.noise()

math.noise(x, y?, z?)

Returns deterministic, smoothly interpolated coherent noise in approximately the -1 to 1 range. Missing Y or Z coordinates default to 0.

Luau
for x = 0, 5 do
    local value = math.noise(x * 0.15, 0, 0)
    print(x, value)
end

task.wait()

task.wait(seconds?)
NameTypeDescription
secondsnumber?Requested delay. Defaults to about one frame.
returnnumberActual elapsed wait time in seconds.
Luau
print("before")
task.wait(0.5)
print("after")