So I'm making a script that requires the function to return two separate values. How would I be able to store those two values? I know I can store one value if I define a variable for the function, but I don't know how to do it for more than one value. Thanks Kevin.
✓ ANSWER ACCEPTED
How to get a function to return more than one value?
1 answer
✓ Accepted answer
local function twoReturnValues()
return "Hello", "world!"
end
local return1, return2 = twoReturnValues()
print(return1) --> Hello
print(return2) --> world!
1 comment
0
Thanks
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
return a,b
How would i store the values in variables?