Just as the topic says.
The HopperBin is supposed to spawn a model where the player clicks.
This said HopperBin is composed of a Script and the said Model.
The Script is following:
bin = script.Parent
function onButton1Down(mouse)
local model = bin.Grenade:clone()
model.Parent = game.Workspace
model:MakeJoints()
model:MoveTo(mouse.hit.p)
end
function onSelected(mouse)
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
bin.Selected:connect(onSelected)
It works properly in HopperBin. However, when I put the Script and the Model in a tool, it does nothing when I click on the ground.
I tried to also add a handle, but it made only to spawn the Model somewhere on the map regardless if I click or not. It just spawns after I equip this tool.
The issue and question is: How do I make this script tool-compatible? I really wish to make the player have a Handle in their hand and spawn a proper Model in the Workspace.
The Model does not have to be in the tool. This Script also worked in HopperBin when the Model was in ServerStorage.
Best regards.

2 comments
HopperBins are deprecated. Do not use them for new work.
I know, but this HopperBin is what I found to be the greatest to perform the function of placing models. I just wish to make it a Tool, so the character will hold a Handle and other bricks.