So i was trying to create 2 objects a value and an attachment when clicking certain part, when i tried using this code:
function clicked (playerWhoClicked)
local startorend = Instance.new("Attachment")
startorend.Parent = script.Parent
local attachment = Instance.new("NumberValue",workspace.attachments)
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
It gave me an error "Attempt to connect failed:Passed value is not a function" then when clicking the part nothing would happen except i'd get the error "attempt to call a nil value" If someone could help me i would apreciate. And sorry for bad grammar (i wasnt born in an english speaking country and never did an english scool.

2 comments
You connected "onClicked". Your function is "clicked".
This is what happens when you copy and paste from roblox wiki...