Tuple

From Legacy Roblox Wiki
Revision as of 19:09, 7 April 2012 by >JulienDethurens
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

A tuple is an ordered list of elements.

In Roblox Lua, the Tuple type refers to a list of Lua variables. If a method accepts a Tuple as an argument, then that means it accepts multiple values. If a method returns a Tuple, then that means it returns multiple values.

As an example, the FindPartOnRay returns a Tuple. More specifically, it returns a Part and a Vector3.

local part, position = Workspace:FindPartOnRay(ray)

The Invoke method in BindableFunction accepts a Tuple as an argument. So, it can accept multiple arguments.

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

See also

External links