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?
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?
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)
yes
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.
2 comments
Please explain a bit more. But you could just call the function twice or more. func() func() func()
You can make something return a series of items, like if you say: return Instance.new("Part"), game.Workspace.Cheeseburger in the function.