Hello, I'm trying to make some custom functions. One of these functions is the "Find" function; this function returns a table with other functions inside. This table is "representing" remote events/remote functions. It has a function under "Fire" which sends information to the server using a remote event. Basically if I had a remote event "Fire" would be like: Event:FireClient(player, [a varying amount of arguments])
. So is there any way that I can make a function with a varying amount of arguments that processes them and sends them through a remote event/remote function?
Thanks
varaidic functions can be achieved, like other languages with an ellipsis (...
)
An example would be:
local function foo(...) local args = {...} for i,v in pairs(args) do print(i,v) end end foo(1,2,3,4,56,7);
something like this can also be achieved if want one definite parameter and a varying range of other parameters
local function foo(name,...) local args = {...} for i,v in pairs(args) do print(i,v) end end foo("foot",1,2,3,4,56,7);
so for your case this would be
Remote.OnClientEvent:Connect(function(plr,...) --blah blah blah end)