Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I print only the 2nd comma of return?

Asked by 5 years ago

I want to print something just like a table using indexes

function returnstuff()

    return 'G','A','Y'
end

print(returnstuff()[2])


--Since Arrays start at 1 this should print A

but I don't know how to do these stuff

1 answer

Log in to vote
1
Answered by
royaltoe 5144 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago
function returnstuff()

    return 'P','A','Y'
end
var1, var2, var3 = returnstuff()
print(var2)
Ad

Answer this question