Skip to content

Instantly share code, notes, and snippets.

@Anaminus
Created October 17, 2019 20:03
Show Gist options
  • Select an option

  • Save Anaminus/092e0a07c1fdaa49d4b175737ed224f9 to your computer and use it in GitHub Desktop.

Select an option

Save Anaminus/092e0a07c1fdaa49d4b175737ed224f9 to your computer and use it in GitHub Desktop.
Descriptions generated from autocomplete.
library core
func getmetatable(table: table): dictionary
Returns the metatable of the specified object if it has one, otherwise
returns nil. If the object does have a metatable, but the metatable has
a __metatable field set, the value of __metatable will be returned
instead.
func setmetatable(table: table, metatable: table?): dictionary
Sets the metatable for the given table. If metatable is nil, the
metatable of the given table is removed. If the original metatable has a
"__metatable" field, this will raise an error. This function returns the
table t, which was passed to the function.
library math
func math.abs(x: number): number
Returns the absolute value of x
func math.acos(x: number): number
Returns the arc cosine of x
func math.asin(x: number): number
Returns the arc sine of x
func math.atan(x: number): number
Returns the arc tangent of x (in radians)
func math.atan2(y: number, x: number): number
Returns the arc tangent of y/x (in radians), but uses the signs of both
parameters to find the quadrant of the result. (It also handles
correctly the case of x being zero.
func math.ceil(x: number): number
Returns the smallest integer larger than or equal to x.
func math.clamp(x: number, min: number, max: number): number
Returns a number between min and max, inclusive.
func math.cos(x: number): number
Returns the cosine of x (assumed to be in radians).
func math.cosh(x: number): number
Returns the hyperbolic cosine of x.
func math.deg(x: number): number
Returns the angle x (given in radians) in degrees.
func math.exp(x: number): number
Returns the value e^x.
func math.floor(x: number): number
Returns the largest integer smaller than or equal to x.
func math.fmod(x: number, y: number): number
Returns the remainder of the division of x by y that rounds the quotient
towards zero.
func math.frexp(x: number): (number, number)
Returns m and e such that x = m2^e, e is an integer and the absolute
value of m is in the range [0.5, 1) (or zero when x is zero).
func math.ldexp(x: number, e: number): number
Returns m2^e (e should be an integer).
func math.log(x: number): number
Returns the natural logarithm of x.
func math.log10(x: number): number
Returns the base-10 logarithm of x.
func math.max(x: number, ...number?): number
Returns the maximum value among its arguments.
func math.min(x: number, ...number?): number
Returns the minimum value among its arguments.
func math.modf(x: number): (number, number)
Returns two numbers, the integral part of x and the fractional part of
x.
func math.noise(x: number, y: number?, z: number?): number
Returns a value between -0.5 and 0.5 generated from its arguments.
func math.pow(x: number, y: number): number
Returns x^y. (You can also use the expression x^y to compute this
value.)
func math.rad(x: number): number
Returns the angle x (given in degrees) in radians.
func math.random(m: number, n: number?): number
This function is an interface to the simple pseudo-random generator
function rand provided by ANSI C. (No guarantees can be given for its
statistical properties.) When called without arguments, returns a
uniform pseudo-random real number in the range [0,1). When called with
an integer number m, math.random returns a uniform pseudo-random integer
in the range [1, m]. When called with two integer numbers m and n,
math.random returns a uniform pseudo-random integer in the range [m, n].
func math.randomseed(x: number): number
Sets x as the seed for the pseudo-random generator: equal seeds produce
equal sequences of numbers.
func math.sign(x: number): number
Returns -1 if x < 0, 0 if x == 0, or 1 if x > 0.
func math.sin(x: number): number
Returns the sine of x (assumed to be in radians).
func math.sinh(x: number): number
Returns the hyperbolic sine of x.
func math.sqrt(x: number): number
Returns the square root of x. (You can also use the expression x^0.5 to
compute this value.)
func math.tan(x: number): number
Returns the tangent of x (assumed to be in radians).
func math.tanh(x: number): number
Returns the hyperbolic tangent of x.
prop math.huge: number
The value HUGE_VAL, a value larger than or equal to any other numerical
value.
prop math.pi: number
The value of pi.
library debug
func debug.traceback(): string
Returns a traceback of the current thread, similar to the one in the
output on error.
func debug.profilebegin()
Opens a microprofiler label.
func debug.profileend()
Closes the top microprofiler label.
library string
func string.byte(s: string, i: number? = 1, j: number? = i): string
Returns the internal numerical codes of the characters s[i], s[i+1],
..., s[j]. The default value for i is 1; the default value for j is i.
These indices are corrected following the same rules of function
string.sub.
func string.char(...number): string
Receives zero or more integers. Returns a string with length equal to
the number of arguments, in which each character has the internal
numerical code equal to its corresponding argument.
func string.dump(function: function): string
Returns a string containing a binary representation of the given
function, so that a later load on this string returns a copy of the
function (but with new upvalues).
func string.find(s: string, pattern: string, init: number? = 1, plain: number? = false): number
Looks for the first match of pattern in the string s. If it finds a
match, then find returns the indices of s where this occurrence starts
and ends; otherwise, it returns nil. A third, optional numerical
argument init specifies where to start the search; its default value is
1 and can be negative. A value of true as a fourth, optional argument
plain turns off the pattern matching facilities, so the function does a
plain 'find='' substring=''' operation"
func string.format(formatstring: string, ...string): string
Returns a formatted version of its variable number of arguments
following the description given in its first argument (which must be a
string).
func string.gmatch(s: string, pattern: string): function
Returns an iterator function that, each time it is called, returns the
next captures from pattern over the string s.
func string.gsub(s: string, pattern: string, repl: nil, n: string?): string
Returns a copy of s in which all (or the first n, if given) occurrences
of the pattern have been replaced by a replacement string specified by
repl, which can be a string, a table, or a function. gsub also returns,
as its second value, the total number of matches that occurred.
func string.len(s: string): number
Receives a string and returns its length.
func string.lower(s: string): string
Receives a string and returns a copy of this string with all uppercase
letters changed to lowercase.
func string.match(s: string, pattern: string, init: string?): string
Looks for the first match of pattern in the string s. If a match is
found, it is returned; otherwise, it returns nil. A third, optional
numerical argument init specifies where to start the search; its default
value is 1 and can be negative.
func string.rep(s: string, n: string, sep: string): string
Returns a string that is the concatenation of n copies of the string s
separated by the string sep.
func string.reverse(s: string): string
Returns a string that is the string s reversed.
func string.sub(s: string, i: string, j: string): string
Returns the substring of s that starts at i and continues until j; i and
j can be negative. If j is absent, then it is assumed to be equal to -1
(which is the same as the string length).
func string.upper(s: string): string
Receives a string and returns a copy of this string with all lowercase
letters changed to uppercase. All other characters are left unchanged.
func string.split(s: string, separator: string?): table
Splits a string into parts based on the defined separator character(s),
returning a table of ordered results. The default separator is comma
(,).
library table
func table.concat(list: string, sep: string?, i: string?, j: string?): string
Given a list where all elements are strings or numbers, returns the
string list[i]..sep..list[i+1] ... sep..list[j]. The default value for
sep is the empty string, the default for i is 1, and the default for j
is #list. If i is greater than j, returns the empty string.
func table.foreach(table: table, f: function)
Apply the function f to the elements of the table passed
func table.foreachi(table: table, f: function)
This is similar to table.foreach() except that index-value pairs are
passed, not key-value pairs.
func table.getn(table: table): number
Returns the number of elements in the table passed
func table.insert(list: table, pos: number?, value: value)
Inserts element value at position pos in list, shifting up the elements
list[pos], list[pos+1], ..., list[#list]. The default value for pos is
#list+1, so that a call table.insert(t,x) inserts x at the end of list
t.
func table.remove(list: table, pos: number?): value
Removes from list the element at position pos, returning the value of
the removed element. When pos is an integer between 1 and #list, it
shifts down the elements list[pos+1], list[pos+2], ..., list[#list] and
erases element list[#list]; The index pos can also be 0 when #list is 0,
or #list + 1; in those cases, the function erases the element list[pos].
func table.sort(list: table, comp: number?): bool
Sorts list elements in a given order, in-place, from list[1] to
list[#list]. If comp is given, then it must be a function that receives
two list elements and returns true when the first element must come
before the second in the final order (so that not
comp(list[i+1],list[i]) will be true after the sort). If comp is not
given, then the standard Lua operator [less than] is used instead.
func table.pack(...value): table
Returns a new table with all arguments stored into keys 1, 2, etc. and
with a field "n" with the total number of arguments.
func table.unpack(list: table, i: number?, j: number?): (...: value)
Returns the elements from the given list between positions i and j. By
default, i is 1 and j is #list.
func table.move(a1: table, f: number, e: number, t: number, a2: table?): table
Moves elements from table a1 to table a2, moving elements in the
positions between f and e from a1 to positions starting from t in a2.
The default for a2 is a1. The destination range can overlap with the
source range.
library coroutine
func coroutine.create(f: function): thread
Creates a new coroutine, with body f. f must be a Lua function.
func coroutine.resume(co: thread, val1: variant?, ...variant?): bool
Starts or continues the execution of coroutine co. The first time you
resume a coroutine, it starts running its body. The values val1, ... are
passed as the arguments to the body function. If the coroutine has
yielded, resume restarts it; the values val1, ... are passed as the
results from the yield. If the coroutine runs without any errors, resume
returns true plus any values passed to yield (if the coroutine yields)
or any values returned by the body function (if the coroutine
terminates). If there is any error, resume returns false plus the error
message.
func coroutine.running(): thread
Returns the running coroutine.
func coroutine.status(co: thread): string
Returns the status of coroutine co, as a string: 'running', if the
coroutine is running (that is, it called status); 'suspended', if the
coroutine is suspended in a call to yield, or if it has not started
running yet; 'normal' if the coroutine is active but not running (that
is, it has resumed another coroutine); and 'dead' if the coroutine has
finished its body function, or if it has stopped with an error.
func coroutine.wrap(f: function): function
Creates a new coroutine, with body f. f must be a Lua function. Returns
a function that resumes the coroutine each time it is called. Any
arguments passed to the function behave as the extra arguments to
resume. Returns the same values returned by resume, except the first
boolean. In case of error, propagates the error.
func coroutine.yield(...variant)
Suspends the execution of the calling coroutine. Any arguments to yield
are passed as extra results to resume.
func coroutine.isyieldable(): bool
Returns true when the running coroutine can yield. A running coroutine
is yieldable if it is not the main thread and it is not inside a
non-yieldable C function.
library utf8
func utf8.char(...number): string
Receives zero or more codepoints as integers, converts each one to its
corresponding UTF-8 byte sequence and returns astring with the
concatenation of all these sequences."
func utf8.codes(s: string): function
Returns values so that the construction [for p, c in utf8.codes(s) do
body end] will iterate over all codepoints in string s, with p being the
position (in bytes) and c the code point of each character. It raises an
error if it meets any invalid byte sequence.
func utf8.codepoint(s: string, i: number?, j: number?): ...number
Returns the codepoints (as integers) from all codepoints in s that start
between byte position i and j (both included). The default for i is 1
and for j is i. It raises an error if it meets any invalid byte
sequence.
func utf8.len(s: string, i: number?, j: number?): (number, number)
Returns the number of UTF-8 codepoints in string s that start between
positions i and j (both inclusive). The default for i is 1 and for j is
-1. If it finds any invalid byte sequence, returns a false value plus
the position of the first invalid byte.
func utf8.offset(s: string, n: number, i: number?): number
Returns the position (in bytes) where the encoding of the n-th codepoint
of s (counting from byte position i) starts. A negative n gets
characters before position i. The default for i is 1 when n is
non-negative and #s + 1 otherwise, so that utf8.offset(s, -n) gets the
offset of the n-th character from the end of the string. If the
specified character is neither in the subject nor right after its end,
the function returns nil.
func utf8.graphemes(s: string, i: number?, j: number?): iterator
Returns values so that `for first, last in utf8.graphemes(s) do local
grapheme = s:sub(first, last) end` will iterate the grapheme clusters of
the string.
func utf8.nfcnormalize(s: string): string
Converts the input string to Normal Form C, which tries to convert
decomposed characters into composed characters.
func utf8.nfdnormalize(s: string): string
Converts the input string to Normal Form D, which tries to break up
composed characters into decomposed characters.
prop utf8.charpattern: string
The pattern "[%z-\x7F\xC2-\xF4][\x80-\xBF]", which matches exactly one
UTF-8 byte sequence, assuming that the subject is a valid UTF-8 string.
library os
func os.time(): number
Returns the number of seconds since the epoch (1 January 1970, 00:00:00)
func os.difftime(t1: number, t2: number): number
Returns the number of seconds from t1 to t2
func os.date(formatString: string?, time: number?): dictionary
Returns a table containing the components (year, hour, etc.) of the
date. The formatString must be either *t or !*t, and time is the same as
the return value of os.time(), defaulting to now.
library bit32
func bit32.arshift(x: number, disp: number): number
Returns the number x shifted disp bits to the right. The number disp may
be any representable integer. Negative displacements shift to the left.
This shift operation is what is called arithmetic shift. Vacant bits on
the left are filled with copies of the higher bit of x; vacant bits on
the right are filled with zeros. In particular, displacements with
absolute values higher than 31 result in zero or 0xFFFFFFFF (all
original bits are shifted out).
func bit32.band(...number): number
Returns the bitwise and of its operands.
func bit32.bnot(x: number): number
Returns the bitwise negation of x. Note that the result is a
non-negative integer (e.g. bit32.bnot(0) = 0xFFFFFFFF, not -1)
func bit32.bor(...number): number
Returns the bitwise or of its operands.
func bit32.btest(...number): number
Returns a boolean signaling whether the bitwise and of its operands is
different from zero.
func bit32.bxor(...number): number
Returns the bitwise exclusive or of its operands.
func bit32.extract(n: number, field: number, width: number?): number
Returns the unsigned number formed by the bits field to field + width -
1 from n. Bits are numbered from 0 (least significant) to 31 (most
significant). All accessed bits must be in the range [0, 31]. The
default for width is 1.
func bit32.replace(n: number, v: number, field: number, width: number?): number
Returns a copy of n with the bits field to field + width - 1 replaced by
the value v. Bits are numbered from 0 (least significant) to 31 (most
significant). All accessed bits must be in the range [0, 31]. The
default for width is 1.
func bit32.lrotate(x: number, disp: number): number
Returns the number x rotated disp bits to the left. The number disp may
be any representable integer. Negative displacements rotate to the
right.
func bit32.lshift(x: number, disp: number): number
Returns the number x shifted disp bits to the left. The number disp may
be any representable integer. Negative displacements shift to the right.
In any direction, vacant bits are filled with zeros. In particular,
displacements with absolute values higher than 31 result in zero (all
bits are shifted out).
func bit32.rrotate(x: number, disp: number): number
Returns the number x rotated disp bits to the right. The number disp may
be any representable integer. Negative displacements rotate to the left.
func bit32.rshift(x: number, disp: number): number
Returns the number x shifted disp bits to the right. The number disp may
be any representable integer. Negative displacements shift to the left.
In any direction, vacant bits are filled with zeros. In particular,
displacements with absolute values higher than 31 result in zero (all
bits are shifted out).
struct Instance
ctor Instance.new(val: string, parent: Instance): Instance
Creates an new object of type val. The parent argument is optional; If
it is supplied, the object will be parented to that object
struct Vector2
ctor Vector2.new(x: number, y: number): Vector2
Creates a new Vector2 using ordinates x and y
func Vector2:Lerp(v: Vector2, alpha: number): Vector2
Returns a Vector2 linearly interpolated between this Vector2 and v by
the fraction alpha
func Vector2:Dot(v: Vector2): Vector2
Returns a scalar dot product of the two vectors
func Vector2:Cross(other: Vector2): Vector2
Returns the cross product of the two vectors
prop Vector2.X: number
The x-coordinate
prop Vector2.Y: number
The y-coordinate
prop Vector2.Unit: Vector2
A normalized copy of the vector
prop Vector2.Magnitude: number
The length of the vector
struct Vector2int16
ctor Vector2int16.new(x: number, y: number): Vector2int16
Creates a new Vector2int16 using ordinates x and y. Similar to Vector2,
but uses integral coordinates
prop Vector2int16.X: number
The x-coordinate
prop Vector2int16.Y: number
The y-coordinate
struct Vector3
ctor Vector3.new(x: number, y: number, z: number): Vector3
Constructs a new Vector3 using coordinates x, y, z.
ctor Vector3.FromNormalId(normal: Enum.NormalId): Vector3
Constructs a new Vector3 in a particular direction.
ctor Vector3.FromAxis(axis: Enum.Axis): Vector3
Constructs a new Vector3 for a particular axis.
func Vector3:Lerp(goal: Vector3, alpha: number): Vector3
Returns a Vector3 linearly interpolated between this Vector3 and the
goal by the fraction alpha
func Vector3:Dot(other: Vector3): number
Returns a scalar dot product of the two vectors
func Vector3:Cross(other: Vector3): Vector3
Returns the cross product of the two vectors
func Vector3:FuzzyEq(other: Vector3, epsilon: number?): bool
Returns whether the two vectors are within `epsilon` of each other,
defaulting to 10^-5.
prop Vector3.X: number
The x-coordinate
prop Vector3.Y: number
The y-coordinate
prop Vector3.Z: number
The z-coordinate
prop Vector3.Unit: Vector3
A normalized copy of the vector - one which has the same direction as
the original but a magnitude of 1
prop Vector3.Magnitude: number
The length of the vector
struct Vector3int16
ctor Vector3int16.new(x: number, y: number, z: number): Vector3int16
Creates a new Vector3int16 using coordinate x, y, z.
prop Vector3int16.X: number
The x-coordinate
prop Vector3int16.Y: number
The y-coordinate
prop Vector3int16.Z: number
The z-coordinate
struct CFrame
ctor CFrame.new(): CFrame
Creates a blank identity CFrame.
ctor CFrame.new(pos: Vector3): CFrame
Creates a CFrame from a Vector3
ctor CFrame.new(pos: Vector3, lookAt: Vector3): CFrame
Creates a CFrame located at pos with it's lookVector pointing towards
the lookAt position.
ctor CFrame.new(x: number, y: number, z: number): CFrame
Creates a CFrame from position (x, y, z).
ctor CFrame.new(x: number, y: number, z: number, qX: number, qY: number, qZ: number, qW: number): CFrame
Creates a CFrame from position (x, y, z) and quaternion (qX, qY, qZ, qW)
ctor CFrame.new(x: number, y: number, z: number, R00: number, R01: number, R02: number, R10: number, R11: number, R12: number, R20: number, R21: number, R22: number): CFrame
Creates a CFrame from position (x, y, z) with an orientation specified
by the rotation matrix [[R00 R01 R02] [R10 R11 R12] [R20 R21 R22]]
ctor CFrame.fromEulerAnglesXYZ(rx: number, ry: number, rz: number): CFrame
Creates a rotated CFrame using angles (rx, ry, rz) in radians. Rotations
are applied in Z, Y, X order.
ctor CFrame.fromEulerAnglesYXZ(rx: number, ry: number, rz: number): CFrame
Creates a rotated CFrame using angles (rx, ry, rz) in radians. Rotations
are applied in Z, X, Y order.
ctor CFrame.Angles(rx: number, ry: number, rz: number): CFrame
Equivalent to fromEulerAnglesXYZ
ctor CFrame.fromOrientation(rx: number, ry: number, rz: number): CFrame
Equivalent to fromEulerAnglesYXZ
ctor CFrame.fromAxisAngle(v: Vector3, r: number): CFrame
Creates a rotated CFrame from a Unit Vector3 and a rotation in radians
ctor CFrame.fromMatrix(pos: Vector3, vX: Vector3, vY: Vector3, vZ: Vector3): CFrame
Creates a CFrame from a translation and the columns of a rotation
matrix.
ctor CFrame.fromMatrix(pos: Vector3, vX: Vector3, vY: Vector3): CFrame
Creates a CFrame from a translation and two columns of a rotation
matrix. The third column is calculated as [vx:Cross(vy).unit]
func CFrame:Inverse(): CFrame
Returns the inverse of this CFrame
func CFrame:Lerp(goal: CFrame, alpha: number): CFrame
Returns a CFrame interpolated between this CFrame and the goal by the
fraction alpha
func CFrame:ToWorldSpace(cf: CFrame): CFrame
Returns a CFrame transformed from Object to World space. Equivalent to
[CFrame * cf]
func CFrame:ToObjectSpace(cf: CFrame): CFrame
Returns a CFrame transformed from World to Object space. Equivalent to
[CFrame:Inverse() * cf]
func CFrame:PointToWorldSpace(v3: Vector3): Vector3
Returns a Vector3 transformed from Object to World space. Equivalent to
[CFrame * v3]
func CFrame:PointToObjectSpace(v3: Vector3): Vector3
Returns a Vector3 transformed from World to Object space. Equivalent to
[CFrame:Inverse() * v3]
func CFrame:VectorToWorldSpace(v3: Vector3): Vector3
Returns a Vector3 rotated from Object to World space. Equivalent to
[(CFrame - CFrame.Position) *v3]
func CFrame:VectorToObjectSpace(v3: Vector3): Vector3
Returns a Vector3 rotated from World to Object space. Equivalent to
[(CFrame:Inverse() - CFrame:Inverse().Position) * v3]
func CFrame:GetComponents(): (number, number, number, number, number, number, number, number, number, number, number, number)
Returns the values: x, y, z, R00, R01, R02, R10, R11, R12, R20, R21, R22
func CFrame:ToEulerAnglesXYZ(): (number, number, number)
Returns approximate angles that could be used to generate CFrame, if
angles were applied in Z, Y, X order
func CFrame:ToEulerAnglesYXZ(): (number, number, number)
Returns approximate angles that could be used to generate CFrame, if
angles were applied in Z, X, Y order
func CFrame:ToOrientation(): (number, number, number)
Returns approximate angles that could be used to generate CFrame, if
angles were applied in Z, X, Y order (Equivalent to ToEulerAnglesYXZ)
func CFrame:ToAxisAngle(): (Vector3, number)
Returns a tuple of a Vector3 and a number which represent the rotation
of the CFrame in the axis-angle representation
prop CFrame.Position: number
The 3D position of the CFrame
prop CFrame.X: number
The x-coordinate of the position
prop CFrame.Y: number
The y-coordinate of the position
prop CFrame.Z: number
The z-coordinate of the position
prop CFrame.LookVector: Vector3
The forward-direction component of the CFrame's orientation.
prop CFrame.RightVector: Vector3
The right-direction component of the CFrame's orientation.
prop CFrame.UpVector: Vector3
The up-direction component of the CFrame's orientation.
struct Region3
ctor Region3.new(min: Vector3, max: Vector3): Region3
Creates a new Region3 out of two Vector3 values.
prop Region3.CFrame: CFrame
The center location and rotation of the Region3
prop Region3.Size: Vector3
The 3D size of the Region3
struct Region3int16
ctor Region3int16.new(min: Vector3int16, max: Vector3int16): Region3int16
Creates a new Region3int16 out of two Vector3int16 structs
struct BrickColor
ctor BrickColor.new(val: number): BrickColor
Constructs a BrickColor from its numerical index.
ctor BrickColor.new(r: number, g: number, b: number): BrickColor
Constructs the closest BrickColor that can be matched to the specified
RGB components.
ctor BrickColor.new(val: string): BrickColor
Constructs a BrickColor from its name.
ctor BrickColor.new(color: Color3): BrickColor
Constructs the closest BrickColor that can be matched to the specified
Color3.
ctor BrickColor.palette(paletteValue: number): BrickColor
Constructs a BrickColor from its palette index.
ctor BrickColor.Random(): BrickColor
Returns a random BrickColor
ctor BrickColor.White(): BrickColor
Returns the BrickColor White
ctor BrickColor.Gray(): BrickColor
Returns the BrickColor Medium stone grey
ctor BrickColor.DarkGray(): BrickColor
Returns the BrickColor Dark stone grey
ctor BrickColor.Black(): BrickColor
Returns the BrickColor Black
ctor BrickColor.Red(): BrickColor
Returns the BrickColor Bright Red
ctor BrickColor.Green(): BrickColor
Returns the BrickColor Dark Green
ctor BrickColor.Blue(): BrickColor
Returns the BrickColor Bright Blue
func BrickColor:Yellow(): BrickColor
Returns the BrickColor Bright Yellow
prop BrickColor.Number: number
The unique number that identifies the BrickColor
prop BrickColor.Name: string
The name associated with the BrickColor
prop BrickColor.Color: Color3
The Color3 associated with the BrickColor
prop BrickColor.g: number
The red component (between 0 and 1)
prop BrickColor.r: number
The green component (between 0 and 1)
prop BrickColor.b: number
The blue component (between 0 and 1)
struct Ray
ctor Ray.new(Origin: Vector3, Direction: Vector3): Ray
Creates a new Ray with given Origin and Direction
ctor Ray.ClosestPoint(point: Vector3): Vector3
Returns the closest point on the Ray to point. Note Rays are
unidirectional
ctor Ray.Distance(point: Vector3): number
Returns the distance from point to ClosestPoint(point)
prop Ray.Origin: Vector3
The position of the origin
prop Ray.Direction: Vector3
The direction vector of the ray
prop Ray.Unit: Ray
The Ray with a normalized direction
struct UDim
ctor UDim.new(Scale: number, Offset: number): UDim
Creates a new UDim from components
prop UDim.Scale: number
The scale value
prop UDim.Offset: number
The offset value
struct UDim2
ctor UDim2.new(xScale: number, xOffset: number, yScale: number, yOffset: number): UDim2
ctor UDim2.new(x: UDim, y: UDim): UDim2
ctor UDim2.fromOffset(xOffset: number, yOffset: number): UDim2
ctor UDim2.fromScale(xScale: number, yScale: number): UDim2
prop UDim2.X: number
The x dimension scale and offset
prop UDim2.Y: number
The y dimension scale and offset
struct TweenInfo
ctor TweenInfo.new(time: number? = 1.0, easingStyle: Enum.EasingStyle? = Enum.EasingStyle.Quad, easingDirection: Enum.EasingDirection? = Enum.EasingDirection.Out, repeatCount: number? = 0, reverses: bool? = false, delayTime: number? = 0): TweenInfo
Creates a new Tweeninfo.
prop TweenInfo.Time: number
The amount of time the tween takes in seconds.
prop TweenInfo.DelayTime: number
The amount of time that elapses before tween starts in seconds.
prop TweenInfo.RepeatCount: number
The number of times the tween repeats after tweening once.
prop TweenInfo.Reverses: bool
Whether or not the tween does the reverse tween once the inital tween
completes.
prop TweenInfo.EasingStyle: Enum.EasingStyle
The style in which the tween executes.
prop TweenInfo.EasingDirection: Enum.EasingDirection
The direction in which the EasingStyle executes.
struct Color3
ctor Color3.new(): Color3
Creates a Color3 whose values are (0,0,0) [black]
ctor Color3.new(r: number, g: number, b: number): Color3
Returns a Color3 with the given red, green, and blue values. The numbers
can range from 0 to 1.
ctor Color3.fromRGB(r: number, g: number, b: number): Color3
Creates a Color3 with the given red, green, and blue. The numbers can
range from 0 to 255.
ctor Color3.fromHSV(h: number, s: number, v: number): Color3
Creates a Color3 with the given hue, saturation, and value. The numbers
can range from 0 to 1.
ctor Color3.toHSV(color: Color3): (number, number, number)
Returns the hue, saturation, and value of a Color3.
func Color3:Lerp(color: Color3, alpha: number): Color3
Returns a Color3 interpolated between two Color3 objects. Alpha is a
number from 0 to 1.
prop Color3.R: number
The red value of the color, from 0 to 1.
prop Color3.G: number
The green value of the color, from 0 to 1.
prop Color3.B: number
The blue value of the color, from 0 to 1.
struct ColorSequence
ctor ColorSequence.new(c: Color3): ColorSequence
Creates a sequence of two keypoints with `c` for each value
ctor ColorSequence.new(c0: Color3, c1: Color3): ColorSequence
Creates a sequence of two keypoints with `c0` and `c1` as the value
ctor ColorSequence.new(keypoints: table): ColorSequence
Creates a sequence of ColorSequenceKeypoints.
prop ColorSequence.Keypoints: table
An array containing ColorSequenceKeypoint values for the ColorSequence.
struct NumberSequence
ctor NumberSequence.new(n: number): NumberSequence
Creates a sequence of two keypoints with `n` for each value
ctor NumberSequence.new(n0: number, n1: number): NumberSequence
Creates a sequence of two keypoints with `n0` and `n1` as the value
ctor NumberSequence.new(keypoints: table): NumberSequence
Creates a new Vector2int16 using ordinates x and y. Similar to Vector2,
but uses integral coordinates
prop NumberSequence.keypoints: table
An array containing keypoint values for the NumberSequence
struct NumberRange
ctor NumberRange.new(value: number): NumberRange
Creates a new NumberRange with the minimum and maximum set to value.
ctor NumberRange.new(minimum: number, maximum: number): NumberRange
Creates a new NumberRange with the provided minimum and maximum. minimum
must be less than or equal to maximum.
prop NumberRange.Min: number
Minimum value. Will always be less than or equal to the maximum.
prop NumberRange.Max: number
Maximum value. Will always be greater than or equal to the minimum.
struct Faces
ctor Faces.new(...NormalId): Faces
Creates a new Faces using list of faces
prop Faces.Top: number
Whether the top face is included
prop Faces.Bottom: number
Whether the bottom face is included
prop Faces.Left: number
Whether the left face is included
prop Faces.Right: number
Whether the right face is included
prop Faces.Back: number
Whether the back face is included
prop Faces.Front: number
Whether the front face is included
struct Axes
ctor Axes.new(...parameter, y: number): Axes
Creates a new Axes using list of axes and/or faces. NormalIds (faces)
are converted to the corresponding axes.
prop Axes.X: number
Whether the X axis is enabled
prop Axes.Y: number
Whether the Y axis is enabled
prop Axes.Z: number
Whether the Z axis is enabled
prop Axes.Top: number
Whether the top face is included
prop Axes.Bottom: number
Whether the bottom face is included
prop Axes.Left: number
Whether the left face is included
prop Axes.Right: number
Whether the right face is included
prop Axes.Back: number
Whether the back face is included
prop Axes.Front: number
Whether the front face is included
struct ColorSequenceKeypoint
ctor ColorSequenceKeypoint.new(time: number, color: Color3): ColorSequenceKeypoint
Creates a keypoint with a specified time and color.
prop ColorSequenceKeypoint.Time: number
The relative time at which the keypoint is located.
prop ColorSequenceKeypoint.Value: Color3
The Color3 value at the keypoint.
struct NumberSequenceKeypoint
ctor NumberSequenceKeypoint.new(time: number, value: number): NumberSequenceKeypoint
Creates a keypoint with a specified time and value.
ctor NumberSequenceKeypoint.new(time: number, value: number, envelop: number): NumberSequenceKeypoint
Creates a keypoint with a specified time, value, and envelope.
prop NumberSequenceKeypoint.Envelope: number
Indicates the amount of variance allowed from the Value. A computed
value.
prop NumberSequenceKeypoint.Time: number
The relative time at which the keypoint is positioned.
prop NumberSequenceKeypoint.Value: number
The base value of this keypoint.
struct Rect
ctor Rect.new(min: Vector2, max: Vector2): Rect
Constructs a new Rect with min as top left corner and max as bottom
right corner.
ctor Rect.new(minX: number, minY: number, maxX: number, maxY: number): Rect
Constructs a new Rect using minX and minY as coordinates for the top
left corner, and maxX and maxY as coordinates for the bottom right
corner.
prop Rect.Min: Vector2
The top-left corner.
prop Rect.Max: Vector2
The bottom-right corner.
prop Rect.Width: number
The width of the Rect in pixels.
prop Rect.Height: number
The height of the Rect in pixels.
struct PhysicalProperties
ctor PhysicalProperties.new(material: Enum.Material): PhysicalProperties
Creates a PhysicalProperties container, with the density, friction, and
elasticity specified for this Material.
ctor PhysicalProperties.new(density: number, friction: number, elasticity: number): PhysicalProperties
Creates a PhysicalProperties container, with the specified density,
friction, and elasticity.
ctor PhysicalProperties.new(density: number, friction: number, elasticity: number, frictionWeight: number, elasticityWeight: number): PhysicalProperties
Creates a PhysicalProperties container, with the specified density,
friction, and elasticity, as well as the weight of the friction and
elasticity.
prop PhysicalProperties.Density: number
The density set for the custom physical properties.
prop PhysicalProperties.Friction: number
The friction set for the custom physical properties.
prop PhysicalProperties.Elasticity: number
The elasticity set for the custom physical properties.
prop PhysicalProperties.FrictionWeight: number
The friction weight set for the custom physical properties.
prop PhysicalProperties.ElasticityWeight: number
The elasticity weight set for the custom physical properties.
struct Random
ctor Random.new(seed: number): Random
Creates a new Random object from the given seed.
ctor Random.new(): Random
Creates a new Random object using a seed pulled from an internal entropy
source.
func Random:NextInteger(min: number, max: number): number
Returns a pseudorandom integer uniformly distributed over [min, max].
func Random:NextNumber(): number
Returns a pseudorandom number uniformly distributed over [0, 1).
func Random:NextNumber(min: number, max: number): number
Returns a pseudorandom number uniformly distributed over [min, max).
func Random:Clone(): Random
Returns a new Random object with the same state as the original.
struct PathWaypoint
ctor PathWaypoint.new(position: Vector3, action: Enum.PathWaypointAction): PathWaypoint
Creates a new PathWaypoint object.
prop PathWaypoint.Position: Vector3
The 3D position of the waypoint
prop PathWaypoint.Action: Enum.PathWaypointAction
The action to be performed at this waypoint
struct EventInstance
func EventInstance:Connect(func: function): RobloxScriptConnection
Registers a function to call each time an event is triggered. Returns a
connection object that can be used to undo this registration.
func EventInstance:Wait(): value
Waits in the current thread until the function next fires, returns the
same information passed to a connected function.
struct RobloxScriptConnection
func RobloxScriptConnection:Disconnect()
Stops the function passed to the Connect call that returned this object
from being called.
prop RobloxScriptConnection.Connected: bool
Indicates if this connection remains active.
keywords
and
break
do
else
elseif
end
false
for
function
if
in
local
nil
not
or
repeat
return
then
true
until
while
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment