:Connect(function) Error

So I have been working on my plugin and I got a error saying:

and the code is basically:
Error2 !

so I dont understand why it gives an error because theres a function called MainFunc and it has a parameter.

Or you cant pass parameters on functions connected to :Connect()?

and also

why does

StraightBt.MouseButton1Click:Connect(MainFunc(straightT))
SlopeBt.MouseButton1Click:Connect(MainFunc(slopeT))
RturnBt.MouseButton1Click:Connect(MainFunc(RturnT))
LturnBt.MouseButton1Click:Connect(MainFunc(LturnT))
LoopBt.MouseButton1Click:Connect(MainFunc(loopT))
EndBt.MouseButton1Click:Connect(MainFunc(endT))

all these events fire when I save the plugin as a local plugin?

and also when I open studio

It’s because you have to pass in a function, what you’re doing right now is calling a function, it doesn’t set the Connect’s argument to a function, you’ll have to do something like this

StraightBt.MouseButton1Click:Connect(function()
    MainFunc(straightT)
end)

For each of them. You could just pass in the function only by writing, StraightBt.MouseButton1Click:Connect(MainFunc), but you’re giving an argument to that function so it wouldn’t help your case