Originally Posted by Rhyono
I'm sure this has a very simple answer, but: How do I choose just a piece of the return from ZoS functions that have multiple? I thought it might be a table, but doing it that way didn't work.
For example (from the wiki):
GetItemLinkTraitInfo(string itemLink)
Returns: number ItemTraitType traitType, string traitDescription, number traitSubtype, string traitSubtypeName, string traitSubtypeDescription
If I wanted just the trait subtype, how would I write that?
|
There is a keyword "select" in Lua.
It starts taking the result variables beginning with the given index:
Code:
local r5, r6 = select(5, func(whatever))
also working:
Code:
local function abc(...)
local count = select("#", ...)
local p2, p3 = select(2, ...)
end