đ_G
Last updated
Last updated
assert(expression: any[, text: string, ...]): any
Name | Type | Description |
---|---|---|
If the result of the first argument is false or nil, an error is thrown with the second argument as the message.
error(text: any[, level: number])
Name | Type | Description |
---|---|---|
Throws a Lua error and breaks out of the current call stack.
getmetatable(object: any): any
Name | Type | Description |
---|---|---|
Returns the metatable of an object. This function obeys the metatable's __metatable field, and will return that field if the metatable has it set.
ipairs(tbl: table): function, table, number
Returns an iterator function for a for loop, to return ordered key-value pairs from a table.
print(text: string[, ...])
Prints the text to the console.
print_error(text: string[, ...])
Prints an error to the console and plays a sound.
print_chat(text: string[, ...])
Prints the text to the in-game chat.
print_raw(text: string[, ...])
Prints the text that can be changed in color by prepending it with "\a"
followed by the color in the hexadecimal "RRGGBB" format. For example, "\aFF0000Hi"
will print "Hi"
in red.
print_dev(text: string[, ...])
Prints the text into the upper-left console panel.
tonumber(value: any[, base: number]):
number
Returns the numeric representation of the value with the given base, or nil
if the conversion failed.
tostring(var: any):
string
Returns the string representation of the value.
type(var: any):
string
Returns the name of the object's type.
unpack(tbl: table, start_index: number, end_index: number):
...
xpcall(func: function, err_callback: function[, ...]):
boolean
, ...
Attempts to call the first function. If the execution succeeds, this returns true
followed by the returns of the function. If execution fails, this returns false
and the second function is called with the error message.
to_ticks(time: number):
number
Converts time (seconds) to ticks.
to_time(ticks: number):
number
Converts ticks to time (seconds).
âšī¸ This class system makes it easier to structure code in complex projects.
new_class():
metatable
Creates the new class.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
expression
any
The expression to assert.
text
text
The error message to throw when assertion fails. This is only type-checked if the assertion fails.
...
any
Any arguments past the error message will be returned by a successful assert.
text
string
The error message to throw.
level
number
The level to throw the error at.
object
any
The value to return the metatable of.
tbl
table
The table to iterate over.
text
string
Text to print into the console.
...
any
Optional arguments to concatenate with text
.
text
string
Text to print into the console.
...
any
Optional arguments to concatenate with text
.
text
string
Text to print into the in-game chat.
...
any
Optional arguments to concatenate with text
.
text
string
Text to print into the console.
...
any
Optional arguments to concatenate with text
.
text
string
Text to print to into the upper-left console panel.
...
any
Optional arguments to concatenate with text
.
value
any
The value to convert. Can be a number or string.
base
number
Optional. The base used in the string. Can be any integer between 2 and 36, inclusive.
var
any
The object to be converted to a string.
var
any
The object to get the type of.
tbl
table
The table to generate the vararg from.
start_index
number
Which index to start from. Optional.
end_index
number
Which index to end at. Optional, even if you set start_index
.
func
function
The function to call initially.
err_callback
function
The function to be called if execution of the first fails. The error message is passed as a string.
...
any
Arguments to pass to the initial function.
time
number
The seconds to convert to ticks.
ticks
number
The number of ticks to convert to time.