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