wait(1)
player = game.Players.LocalPlayer
mouse = player:GetMouse()
mouse.Button1Down:connect(function(click)
if mouse.Target~=nil then --Check to make sure it wont break
if mouse.Target.Name == "ATM" then --Needs to check its name
if mouse.Target:isA("Part") then
mouse.Target:clone()
mouse.Target.Parent = player.backpack
elseif mouse.Target == nil then
print("Error")
end
end
end
end)
Hi, thank you for reading. What I'm trying to do is that when you click on a part, the part will clone into the players backpack. I use mouse.Target, but it doesn't seem to work. Can anyone help me?

5 comments
Thank you, sir. You explained a lot to me. I will take this knowledge and learn from it :)
Last question, why can't I put "Part"? Is that not a filter or something?
No problem. Part works as a filter, it's just that BasePart is a classname, so it works for a wide variety of parts instead of simply normal parts.
Both "isA" and "IsA" are correct usage of the method. As for everything else, good explanation.
Alright, didn't know that. I'll edit that out, thanks.