Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I go about getting multiple results?

How would I go about to get multiple results from function or lua in general

For example lets say I wanted where if you got hit it could range from several numbers like 36 19 40.

I mean could I just use a table?

2 comments

0

Please explain a bit more. But you could just call the function twice or more. func() func() func()

0

You can make something return a series of items, like if you say: return Instance.new("Part"), game.Workspace.Cheeseburger in the function.

1 answer

✓ Accepted answer

Are you talking about returning muliple data from a function, like so?

local a = 5
local b = 8
local c = 3

function GetData()
return a, b, c
end

local  d, e, f = GetData() 
print(d+e+f)

2 comments

0

yes

0

If I answered your question and you have nothing else to ask. Could you thumb up?

This discussion is preserved as it was. New answers, comments, and votes are closed.