So I am having trouble making a barricade tool that when the model is placed (or the mouse is clicked) will place my block model. I am needing some help on adding a peice of script that will delete the tool from my backpack/inventory (im using the standard roblox backpack).
Here is my script so far:
bin = script.Parent
function onButton1Down(mouse)
local model = bin.model:clone()
model.Parent = game.Workspace
model:MakeJoints()
model:MoveTo(mouse.hit.p)
end
function onSelected(mouse)
mouse.Icon = "rbxasset://textures\\GunCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
if enabled then
player.Backpack.tool:Destroy()
end
bin.Selected:connect(onSelected)

1 comment
HopperBins are deprecated! You should be using tools.