A 字串 是一個值列表。在 Roblox 引擎 API 中有許多 方法 和 回呼 接受和返回多個值,但 API 參考說「Tuple」而不是這些值。
參數
如果 方法 或 回呼 接受 tuple 作為參數,則會接受多個值。例如,API 參考顯示 BindableFunction:Invoke() 方法接受 "Tuple" 作為參數,因此接受多個參數。
BindableFunction:Invoke(1, true, "string", Vector3.new(0, 0, 0))
返回
如果 方法 或 回呼 返回 tuple,則會返回多元組值。例如,API 參考顯示 Players:GetUserThumbnailAsync() 方法返回 "Tuple",因此返回多個值。第一個返回值是內容URL,第二個是boolean。
local Players = game:GetService("Players")local userId = 156 -- 建造者local thumbType = Enum.ThumbnailType.HeadShotlocal thumbSize = Enum.ThumbnailSize.Size420x420local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)print(content, isReady) -- rbxthumb://type=AvatarHeadShot&id=156&w=420&h=420 true