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

How to convert a table into variadic arguments instead of the other way around?

I want to be able to do

local function CallFunction(...)
	print(...) -- Prints "Player1 Player2"
end
local table = {"Player1", "Player2"}
CallFunction(InsidesOfTable)

I'm going to have a table full of functions and they can have infinite parameters so I would like to send them without just sending the table but I can't think of a way without doing that

1 answer

If I remember correctly, you could either just pass the table through, or make a loop inside the function to go through the arguments passed in.

1 comment

0

Nope, I have to use unpack()

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