When I added a small function to my script to check if the Mouse's target was an object, it started giving me an error: Attempt to connect failed: Passed value is not a function at line 4.
script.Parent.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
if mouse.Target == nil then
else mouse.Button1Down:connect(Check)
end
function Check()
--the rest of script goes down here. It's been working fine.
I'm not sure what it means that the value is not a function. I have a guess that it might have to do with me use mouse.Button1Down twice, but I'm not sure (also, I didn't know what other Event to put there).

5 comments
No no no. If the Target does equal nil, I want it to end. If it DOESN'T equal nil, I want it to run the function.
okay, try now with updated post
Output is "attempt to call global 'Check' (a nil value)" at line 4. I think it's because you're not connecting to Check(), you're just stating "Check()".
try making function Check() before the event :P It will work
(sorry about late-ish response). But no, it doesn't work because now the word "mouse" in the function at line 2 doesn't work (since it isn't defined until later).