Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Hopper Bin Problem?

Asked by 9 years ago

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

Log in to vote
1
Answered by 9 years ago
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)
Ad

Answer this question