.Activatet is executed although it was not clicked

I want a function to be called when I click on a button. The problem script is in a plugin.
Error:
When I update the plugin, this error occurs for all buttons:

Output:

11:55:19.213 Finished installing plugin. - Studio
11:55:19.364 BillboardGui - Edit
11:55:19.365 Attempt to connect failed: Passed value is not a function - Studio
11:55:19.365 Stack Begin - Studio
11:55:19.365 Script ‘cloud_14395868615.GuiConvertPlugincode.GuiConvertPlugin.Selcettiontoconvert’, Line 94 - Studio
11:55:19.365 Stack End - Studio
11:55:19.365 Frame - Edit
11:55:19.365 Attempt to connect failed: Passed value is not a function - Studio
11:55:19.365 Stack Begin - Studio
11:55:19.365 Script ‘cloud_14395868615.GuiConvertPlugincode.GuiConvertPlugin.Selcettiontoconvert’, Line 95 - Studio
11:55:19.366 Stack End - Studio
11:55:19.366 ImageButton - Edit
11:55:19.366 Attempt to connect failed: Passed value is not a function - Studio
11:55:19.366 Stack Begin - Studio
11:55:19.366 Script ‘cloud_14395868615.GuiConvertPlugincode.GuiConvertPlugin.Selcettiontoconvert’, Line 96 - Studio
11:55:19.366 Stack End - Studio
11:55:19.367 ImageLabel - Edit
11:55:19.367 Attempt to connect failed: Passed value is not a function - Studio
11:55:19.368 Stack Begin - Studio
11:55:19.368 Script ‘cloud_14395868615.GuiConvertPlugincode.GuiConvertPlugin.Selcettiontoconvert’, Line 97 - Studio
11:55:19.368 Stack End - Studio
11:55:19.369 ScreenGui - Edit
11:55:19.369 Attempt to connect failed: Passed value is not a function - Studio
11:55:19.369 Stack Begin - Studio
11:55:19.369 Script ‘cloud_14395868615.GuiConvertPlugincode.GuiConvertPlugin.Selcettiontoconvert’, Line 98 - Studio
11:55:19.369 Stack End - Studio
11:55:19.369 ScrollingFrame - Edit
11:55:19.369 Attempt to connect failed: Passed value is not a function - Studio
11:55:19.369 Stack Begin - Studio
11:55:19.370 Script ‘cloud_14395868615.GuiConvertPlugincode.GuiConvertPlugin.Selcettiontoconvert’, Line 99 - Studio
11:55:19.370 Stack End - Studio
11:55:19.370 SurfaceGui - Edit
11:55:19.370 Attempt to connect failed: Passed value is not a function - Studio
11:55:19.370 Stack Begin - Studio
11:55:19.370 Script ‘cloud_14395868615.GuiConvertPlugincode.GuiConvertPlugin.Selcettiontoconvert’, Line 100 - Studio
11:55:19.370 Stack End - Studio
11:55:19.370 TextButton - Edit
11:55:19.370 Attempt to connect failed: Passed value is not a function - Studio
11:55:19.370 Stack Begin - Studio
11:55:19.370 Script ‘cloud_14395868615.GuiConvertPlugincode.GuiConvertPlugin.Selcettiontoconvert’, Line 101 - Studio
11:55:19.370 Stack End - Studio
11:55:19.370 TextBox - Edit
11:55:19.371 Attempt to connect failed: Passed value is not a function - Studio
11:55:19.371 Stack Begin - Studio
11:55:19.371 Script ‘cloud_14395868615.GuiConvertPlugincode.GuiConvertPlugin.Selcettiontoconvert’, Line 102 - Studio
11:55:19.371 Stack End - Studio
11:55:19.371 TextLabel - Edit
11:55:19.371 Attempt to connect failed: Passed value is not a function - Studio
11:55:19.371 Stack Begin - Studio
11:55:19.371 Script ‘cloud_14395868615.GuiConvertPlugincode.GuiConvertPlugin.Selcettiontoconvert’, Line 103 - Studio
11:55:19.371 Stack End - Studio
11:55:19.371 VideoFrame - Edit
11:55:19.371 Attempt to connect failed: Passed value is not a function - Studio
11:55:19.371 Stack Begin - Studio
11:55:19.371 Script ‘cloud_14395868615.GuiConvertPlugincode.GuiConvertPlugin.Selcettiontoconvert’, Line 104 - Studio
11:55:19.371 Stack End - Studio
11:55:19.372 ViewportFrame - Edit
11:55:19.372 Attempt to connect failed: Passed value is not a function - Studio
11:55:19.372 Stack Begin - Studio
11:55:19.372 Script ‘cloud_14395868615.GuiConvertPlugincode.GuiConvertPlugin.Selcettiontoconvert’, Line 105 - Studio
11:55:19.372 Stack End - Studio
11:55:19.372 CanvasGroup - Edit
11:55:19.373 Attempt to connect failed: Passed value is not a function - Studio
11:55:19.373 Stack Begin - Studio
11:55:19.373 Script ‘cloud_14395868615.GuiConvertPlugincode.GuiConvertPlugin.Selcettiontoconvert’, Line 106 - Studio
11:55:19.374 Stack End - Studio

And in addition, a print is output which can only be output if an ImageButton was activated. Which was not the case.

Code:
--he most important excerpts
local selectet = gui.#.# --I do not let anything leak
--
local GuiButton = Auswahl.GUI
--
local BIG = Auswahl.BillboardGui
local CAG = Auswahl.CanvasGroup
local FRG = Auswahl.Frame
local IMBG = Auswahl.ImageButton
local IMLG = Auswahl.ImageLabel
local SCG = Auswahl.ScreenGui
local SCFG = Auswahl.ScrollingFrame
local SUG = Auswahl.SurfaceGui
local TEBG = Auswahl.TextButton
local TEFG = Auswahl.TextBox
local TELG = Auswahl.TextLabel
local VIDFG =Auswahl.VideoFrame
local VIEFG = Auswahl.ViewportFrame
local function hideallGUI()
BIG.Visible = false
CAG.Visible = false
FRG.Visible = false
IMBG.Visible = false
IMLG.Visible = false
SCG.Visible = false
SCFG.Visible = false
SUG.Visible = false
TEBG.Visible = false
TEFG.Visible = false
TELG.Visible = false
VIDFG.Visible = false
VIEFG.Visible = false
end
local function hideall1()
	GuiButton.Visible = false
end
local function hideALL()
	hideallGUI()
	hideall1()
end
local function clicked(a)
	hideALL()
	selectet.Text = tostring(a)
	print(a)
end
--check all of if they are clicked
BIG.Activated:Connect(clicked(BIG))
FRG.Activated:Connect(clicked(FRG))
IMBG.Activated:Connect(clicked(IMBG))
IMLG.Activated:Connect(clicked(IMLG))
SCG.Activated:Connect(clicked(SCG))
SCFG.Activated:Connect(clicked(SCFG))
SUG.Activated:Connect(clicked(SUG))
TEBG.Activated:Connect(clicked(TEBG))
TEFG.Activated:Connect(clicked(TEFG))
TELG.Activated:Connect(clicked(TELG))
VIDFG.Activated:Connect(clicked(VIDFG))
VIEFG.Activated:Connect(clicked(VIEFG))
CAG.Activated:Connect(clicked(CAG))

Thanks for your help in advance, if you need more material just ask.

Thank you!

You need to use without () to pass a function, not run it or add function
Example:

--1
BIG.Activated:Connect(clicked) --this passes the arguments to the Activated function
--2
BIG.Activated:Connect(function() clicked(BIG) end)

Thanks for the quick good help!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.