Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can you remove a block when a StarterGear item is on and when you click on it?

The title says it all.

1 answer

✓ Accepted answer
local tool = script.Parent -- Make sure the parent is a HopperBin inside of StarterGear
tool.Selected:connect(function(mouse) -- When the tool is selected...
	mouse.Button1Down:connect(function()-- When the mouse is clicked...
		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.]]
			mouse.Target:remove()-- Remove the object
	end)
end)

Hope i helped!

This discussion is preserved as it was. New answers, comments, and votes are closed.