mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-25 04:54:07 +00:00
update rules
This commit is contained in:
parent
4c390fdd37
commit
d5522b2fef
8549 changed files with 11783 additions and 1888 deletions
28
.cursor/rules/roblox/en-us/luau/tuples.md
Normal file
28
.cursor/rules/roblox/en-us/luau/tuples.md
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
title: Tuples
|
||||
description: Tuples are lists of values.
|
||||
---
|
||||
|
||||
A **tuple** is a list of values. Many [methods](./functions.md#methods) and [callbacks](./functions.md#callbacks) in the [Roblox Engine API](/reference/engine) accept and return multiple values, but the API Reference says "Tuple" instead of those values.
|
||||
|
||||
## Parameters
|
||||
|
||||
If a [method](./functions.md#methods) or [callback](./functions.md#callbacks) accepts a tuple as a parameter, then it accepts multiple values. For example, the API Reference shows that the `Class.BindableFunction:Invoke()` method accepts a "Tuple" as a parameter, so it accepts multiple arguments.
|
||||
|
||||
```lua
|
||||
BindableFunction:Invoke(1, true, "string", Vector3.new(0, 0, 0))
|
||||
```
|
||||
|
||||
## Returns
|
||||
|
||||
If a [method](./functions.md#methods) or [callback](./functions.md#callbacks) returns a tuple, then it returns multiple values. For example, the API Reference shows that the `Class.Players:GetUserThumbnailAsync()` method returns a "Tuple", so it returns multiple values. The first return value is a Content URL, and the second is a [boolean](./booleans.md).
|
||||
|
||||
```lua
|
||||
local Players = game:GetService("Players")
|
||||
|
||||
local userId = 156 -- builderman
|
||||
local thumbType = Enum.ThumbnailType.HeadShot
|
||||
local thumbSize = Enum.ThumbnailSize.Size420x420
|
||||
local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)
|
||||
print(content, isReady) -- rbxthumb://type=AvatarHeadShot&id=156&w=420&h=420 true
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue