i am trying to run a function that uses a clickdetector to start it but i keep getting the error that it was unable to connect the button and the function so whats wrong with the connect line?
button1e.ClickDetector.MouseClick:connect(buttonPressed(button1e, floor1, 1, floor1Arrived))
You problem with the given code is that you have too many parameters on MouseClick. The only parameter of MouseClick is a pointer to the player who clicked. Also, the parameters of the function do not belong in the connection line, but rather in the function line.
local button1e = game.Workspace.Button1e -- location of button1e function buttonPressed(playerWhoClicked) -- playerWhoClicked is the only possible parameter for the MouseClick function, varaible can be named anything though. -- code end button1e.ClickDetector.MouseClick:connect(buttonPressed)
I'm not sure how your parameters for buttonPressed in your connection line fit into the script, so I can't really help you there unless you post more of your script.