How to Insert Tools Using a Script in Roblox Script Builder

TIME : 2016-01-07
How to Insert Tools Using a Script in Roblox Script Builder

Here's a basic script that adds a delete tool to the StarterPack and removes each player's torso:

G = Instance.new("HopperBin")
G.Parent = game.StarterPack
G.BinType = 7
local c = game.Players:children()
for i=1,#c do
c[i].Character.Torso:remove()
end

The BinType = 7 line is what makes it a delete tool. If you'd rather give players one of the built-in game tools, change the 7 to 6, 5, 4, 3, 2, 1, or 0. To create a completely custom tool, set it to 8 instead—though scripting that fully is a bit more involved and goes beyond this simple example.