Table Of Contents

Previous topic

timer

Next topic

util.Base64

This Page

util

Constructor

class util()

Methods

abs(number)
Arguments:
  • number – to take abs of
Returns:

returns absolute value of argument.

acos(float)
Arguments:
  • float – to take arccosine of
Returns:

angle in radians

asin(float)
Arguments:
  • float – to take arcsine of
Returns:

angle in radians

CFrame(pos, lookAt, up)
Arguments:
  • pos – The position of the coordinate frame.
  • lookAt – The point in world space that the coordinate frame should look at (the -z axis of the coordinate frame will point at this point).
  • up – (Optional) A vector in world space that represents the up direction of the coordinate frame. Defaults to <0, 1, 0>.
cos(angle)
Arguments:
  • angle – in radians to take cosine of
Returns:

cosine of that angle

div(lhs, rhs)
Arguments:
  • lhs
  • rhs

Overloads the ‘/’ operator.

Checks if lhs has a div function defined on it. If it does, then returns lhs.div(rhs). Otherwise, returns normal js division.

exp(exponent)
Arguments:
  • exponent
Returns:

returns e to the exponent

identifier()
Arguments:
  • optional – {string} space id
  • optional – {string} presence id
Returns:

without any arguments, returns a string with default null values for both space identifier and presence identifier. With single arg, returns identifier with argument’s space id, but with a null presence identifier. With two args, returns full id as string with both space id and presence id.

Return type:

string

mod(lhs, rhs)
Arguments:
  • lhs
  • rhs

Overloads the ‘%’ operator.

Checks if lhs has a mod function defined on it. If it does, then returns lhs.mod(rhs). Otherwise, returns normal js modulo.

mul(lhs, rhs)
Arguments:
  • lhs
  • rhs

Overloads the ‘*’ operator.

Checks if lhs has a mul function defined on it. If it does, then returns lhs.mul(rhs). Otherwise, returns normal js *.

plus(lhs, rhs)
Arguments:
  • lhs
  • rhs

Overloads the ‘+’ operator.

Checks if lhs has a plus function defined on it. If it does, then calls lhs.plus(rhs). If it doesn’t, call javascript version of +

pow(base, exponent)
Arguments:
  • base
  • exponent
Returns:

returns base to the exponent

rand()
Returns:a random float from 0 to 1
sin(angle)
Arguments:
  • angle – in radians to take sine of
Returns:

sine of that angle

sqrt(takes)
Arguments:
  • takes – in a single argument
Returns:

returns a float

sub(lhs, rhs)
Arguments:
  • lhs
  • rhs

Overloads the ‘-‘ operator.

Checks if lhs has a sub function defined on it. If it does, then calls lhs.sub(rhs). If it doesn’t, javascript version of -.