How pass arguments to function through event

Maybe this’s already posted, but I can’t find any topics about this.

local button = someGui.TextButton
local function Something(arg1, arg2, arg3)

button.MouseClick1:Connect(??? -- how I can trigger function Something() with 3+- arguments? -- )

Does someone can say me, how I should paste arguments arg1, arg2… through this event?

These signals are created and fired by the engine so any arguments would be on the engine to pass which in MouseButton1Click’s case it doesn’t fire with any. You need to use a lambda to reroute arguments. Might not work for every case though, depends on your use case and structuring.

MouseButton1Click:Connect(function ()
    Something(your, arguments, here)

I know this variant, but I’m interested, can I somehow use only one function, instead of calling function which calling another function.

No, not possible. As I mentioned before, these signals are fired by the engine so it’s on the engine to fire them with arguments. Developers cannot fire these signals so in turn you can’t directly connect and send or receive arguments in the way you want to.

Currently there isn’t any method unless you make your own Signal module

a simple solution

local function ConnectEvent(event, callback, ...)
  return event:Connect(function() callback(...) end)