Connected is not a valid member of RBXScriptSignal

Hi, i’m making a crafting system and i’m making it so that when you click the GUI, if you have the materials, you’ll get the item. My current code is here:

CraftingSpaceOne.MouseButton1Click:Connected(function(Player)
	if CraftingSpaceOne.CraftableName.Value then
		local toolname = CraftingSpaceOne.CraftableName.Value
		local ClonedTool = game.Workspace.ServerScriptService.Script[toolname]:Clone()
		ClonedTool.Parent = plr.Backpack
	end
end)

however, I get an error in

CraftingSpaceOne.MouseButton1Click:Connected(function(Player)

what am I doing wrong? the error is

Connected is not a valid member of RBXScriptSignal  
1 Like

Hey! The error is literal, just change :Connected to :Connect.

7 Likes

CraftingSpaceOne.MouseButton1Click:Connect(function(Player)
if CraftingSpaceOne.CraftableName.Value then
local toolname = CraftingSpaceOne.CraftableName.Value
local ClonedTool = game.Workspace.ServerScriptService.Script[toolname]:Clone()
ClonedTool.Parent = plr.Backpack
end
end)

1 Like

Connected is not a member, it’s connect

1 Like

You Just Have to Change the Script to

CraftingSpaceOne.MouseButton1Click:Connect(function(Player)
	if CraftingSpaceOne.CraftableName.Value then
		local toolname = CraftingSpaceOne.CraftableName.Value
		local ClonedTool = game.Workspace.ServerScriptService.Script[toolname]:Clone()
		ClonedTool.Parent = plr.Backpack
	end
end)

Only needed to Change :Connected to :Connect

1 Like