Tuples

A tuple is a list of values. Many methods and callbacks in the Roblox Engine API accept and return multiple values, but the API Reference says "Tuple" instead of those values.

Parameters

If a method or callback accepts a tuple as a parameter, then it accepts multiple values. For example, the API Reference shows that the BindableFunction:Invoke() method accepts a "Tuple" as a parameter, so it accepts multiple arguments.


1BindableFunction:Invoke(1, true, "string", Vector3.new(0,0,0))
2

Returns

If a method or callback returns a tuple, then it returns multiple values. For example, the API Reference shows that the 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.


1local Players = game:GetService("Players")
2
3local userId = 156 -- builderman
4local thumbType = Enum.ThumbnailType.HeadShot
5local thumbSize = Enum.ThumbnailSize.Size420x420
6local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)
7print(content, isReady) -- rbxthumb://type=AvatarHeadShot&id=156&w=420&h=420 true
8