Lua Globals

顯示已棄用項目

*此內容很快就會推出您所選的語言版本。

The following is a list of functions and variables that are native to Lua. These functions can be used in a standard installation of Lua 5.1.4, though there are some differences in how some of these work on Roblox.

概要

函式

屬性

  • A table that is shared between all scripts of the same context level.

  • A global variable that holds a string containing the current interpreter version.

函式

assert

Variant

參數

value: Variant
errorMessage: string
預設值:assertion failed!

返回

Variant

error

void

參數

message: string
level: number
預設值:1

返回

void

gcinfo

返回

getmetatable

Variant

參數

t: Variant

返回

Variant

loadstring

Variant

參數

contents: string
chunkname: string

返回

Variant

newproxy

參數

addMetatable: bool
預設值:false

返回

參數

pcall

參數

func: function
args: Tuple

返回

Variant

print

void

參數

params: Tuple

返回

void

rawequal

參數

v1: Variant
v2: Variant

返回

rawget

Variant

參數

index: Variant

返回

Variant

rawlen

參數

返回

rawset

參數

index: Variant
value: Variant

返回

require

Variant

參數

module: ModuleScript

返回

Variant

select

參數

index: Variant
args: Tuple

返回

setmetatable

參數

newMeta: Variant

返回

tonumber

Variant

參數

arg: Variant
base: number
預設值:10

返回

Variant

tostring

參數

e: Variant

返回

type

參數

v: Variant

返回

unpack

Variant

參數

list: table
預設值:1
預設值:#list

返回

Variant

xpcall

參數

args: Tuple

返回

Variant

屬性

A table that is shared between all scripts of the same context level.

_VERSION

A global variable (not a function) that holds a string containing the current interpreter version.