I have this code:
local function a(n)
return n
end
local b = game.Workspace.Button2.Button.ClickDetector.MouseClick:Connect(a("Test"))
print(b)
It should call the function a and pass "Test" to it, but an error occurs when the script is run:
Attempt to connect failed: Passed value is not a function
Yet, this does the same thing and still works:
local function a(n)
return n
end
print(a("Test"))

1 comment
Can't answer due to the 1.5 minute cooldown, but from what I know, you can only pass functions into the Connect function.