Sorry if this is something really easy to learn, but I just don't get it. I'm trying to connect to my function while passing along the argument for num1.
wait()
player = game.Players.LocalPlayer
MainGUI = script.Parent.ScreenGui
Scroll = MainGUI.ScrollingFrame
RStorage = game:GetService("ReplicatedStorage")
ClassFolder = RStorage.ClassFolder
-- Button List
Class1 = Scroll.Class1
Class1Event = ClassFolder.Class1Event
function mainEvent(num1)
if num1 == 1 then
Class1Event:FireServer()
end
end
Class1.MouseButton1Down:connect(mainEvent(1))
It gives me the error: "Attempt to connect failed: Passed value is not a function" and afterwards "attempt to call a nil value"
The error is line 19

3 comments
Why would you want an argument which will be the same forever? Just use variables!
I'm pretty new at scripting, how would you do this?
Re-read my answer btw