The title says it all.
1 | local tool = script.Parent -- Make sure the parent is a HopperBin inside of StarterGear |
2 | tool.Selected:connect( function (mouse) -- When the tool is selected... |
3 | mouse.Button 1 Down:connect( function () -- When the mouse is clicked... |
4 | if mouse.Target ~ = nil and mouse.Target.Name = = "Part" then -- [[Change the Part to whatever the name of the object is, this makes sure that the part that the mouse is clicking isn't a random part that is crucial.]] |
5 | mouse.Target:remove() -- Remove the object |
6 | end ) |
7 | end ) |
Hope i helped!