PcoWSkbVqDnWTu_dm2ix "> ">
We use cookies on this site to enhance your user experience

Sep 25 2019, 2:01 PM PST 2 min

In Roblox, the tuple type refers to a list of Lua variables. If a Articles/Method|method accepts a tuple as an argument, that means it accepts multiple values. If a method returns a tuple, that means it returns multiple values.

As an example, the BindableFunction/Invoke|Invoke() method in BindableFunction accepts a tuple as an argument, meaning it can accept multiple arguments.

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

As another example, Workspace/FindPartOnRay|FindPartOnRay() returns a tuple. More specifically, it returns a Part and a DataType/Vector3|Vector3.

local ray = Ray.new(Vector3.new(0, 0, 0), Vector3.new(50, 50, 10))
local part, position = workspace:FindPartOnRay(ray)
print(part, position)
  • lua
  • value
  • tuple