Example:
There are 100 parts named "SelectionBox" in the workspace. There's a LocalScript inside the player when ever the player's mouse hovers on the part named "SelectionBox" it will destroy it!
|FAILED STRATEGY 1|
How:
- Create a ClickDetector inside each Box
- Connect into single one of it (1. Waste of time)
- Add this script:
script.Parent.ClickDetector.MouseHoverEnter:connect(function()
script.Parent:Destroy()
end)
(2. Creates a lag a.k.a low response to the whole server)
|FAILED STRATEGY 2| <- Changing the box properties instead of destroying it
How:
- Add this in the LocalScript:
--Get Mouse
mouse.Moved:connect(function()
if mouse.Target ~= nil then
if mouse.Target.Name == "SelectionBox" then
box = mouse.Target --Save the box in-case the mouse unhovers it
box.Transparency = 0.5
else
box.Transparency = 0
end
end
end)
(But what if you hover on another part instead of the SelectionBox? Well the script will also cause an error.) (But what if the SelectionBox you just hover get destroyed? Well the script will also cause an error.)

1 comment
I can re-edit this. Thanks!