In Epix Admin's MainModule, I see . . . in some places. This is what I mean:
01 | local MainScriptFunction = function (server,Plugins,LoaderScript) --server is known as "set" in the loader/settings |
02 | local server,Plugins,LoaderScript = server,Plugins,(LoaderScript or script) |
03 | local DebugErrorsLog = { } local function logError(plr, error ) DebugErrorsLog [ #DebugErrorsLog+ 1 ] = { Player = plr,Error = error } end |
04 | local print = function (...) for i,v in pairs ( { ... } ) do print ( '[EISS] Server - ' .. tostring (v)) end end |
05 | local cPcall = function (func,...) local function cour(...) coroutine.resume(coroutine.create(func),...) end local ran, error = pcall (cour,...) if error then logError( "SERVER" , error ) print ( 'ERROR: ' .. error ) end end |
06 | local Pcall = function (func,...) local ran, error = pcall (func,...) if error then logError( "SERVER" , error ) print ( 'ERROR: ' .. error ) end end |
07 | local Routine = function (func,...) coroutine.resume(coroutine.create(func),...) end |
08 | if server.TempAdmins and type (server.TempAdmins) = = "table" then server.Mods = server.TempAdmins end |
09 | pcall ( function () workspace.AllowThirdPartySales = true end ) -- y u even add this roblox.... y |
10 | local DataStore local UpdatableSettings = { } for i,v in pairs (server) do table.insert(UpdatableSettings,i) end |
11 | local DataStore; |
12 | local RemoteEvent; |
Do you know why there is ". . ."?
The ...
is used to create variadic functions, i.e. functions which can take as many arguments as are passed to it. You can define one like this:
1 | function VariadicFunction(...) |
2 | local Args = { ... } |
3 | for i, v in ipairs (Args) do |
4 | print (v) -- Note that we could have used print(...) as print is a variadic function, but this is to show how to iterate over those arguments. |
5 | end |
6 | end |
Note that we put the contents of ...
into a table to make iterating easier.
You can also define arguments before the ...
, like this:
1 | function VariadicFunction(firstArg, secondArg, ...) |
In this case, ...
would represent everything after the second argument passed to the function.