I ask this because I have been getting the error 'Attempt to connect failed: Passed value is not a function.' It doesn't give me which line the error occurs so I don't what I have done wrong. The script for reference:
local Mouse function onClick() local animation = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.Animation) animation:Play() end function onEquip(a) if Mouse ~= nil then Mouse = a Mouse.Button1Down:connect(onClick()) end end script.Parent.Equipped:connect(onEquip())
onEquip()
is what you do when you want to call the function. It's not the function itself. Replace with:
script.Parent.Equipped:connect(onEquip)
You have the same problem on line 11