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

Hopper Bin Problem?

So i want the tool if you hover over the part name "HitBox" then it will get a selection box on it, but it does not work.

function onSelected(mouse)
	if mouse.Target.Name == "HitBox" then
		local pow = Instance.new("SelectionBox", mouse.Target)
		pow.Adornee = mouse.Target
		pow.Name = "SelectionBox"
	end
	mouse.Button1Down:connect(function() onButton1Down(mouse) end) -- this is only a part of a script ignore this
end



bin.Selected:connect(onSelected)

1 answer

✓ Accepted answer
function onSelected(mouse)
  mouse.Move:connect(function()
    if mouse.Target.Name == "HitBox" then
        local pow = Instance.new("SelectionBox", mouse.Target)
        pow.Adornee = mouse.Target
        pow.Name = "SelectionBox"
    end
end)

    mouse.Button1Down:connect(function() onButton1Down(mouse) end) -- this is only a part of a script ignore this
end



bin.Selected:connect(onSelected)

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