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

How do I go about getting multiple results?

Asked by 8 years ago

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?

0
Please explain a bit more. But you could just call the function twice or more. func() func() func() minikitkat 687 — 8y
0
You can make something return a series of items, like if you say: return Instance.new("Part"), game.Workspace.Cheeseburger in the function. Legojoker 345 — 8y

1 answer

Log in to vote
1
Answered by
Kurieita 125
8 years ago

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)
0
yes AthoronTheBrave 45 — 8y
0
If I answered your question and you have nothing else to ask. Could you thumb up? Kurieita 125 — 8y
Ad

Answer this question