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

How do you make a tool-giver?

Like the ones we all see in the Free-Models in Studio. The type of tool-giver is a 'click-able' one When clicked it sends a tool to your inventory.

If you need a tool for an example, please use either a brick or a weapon from the Roblox "Weapons" set in the Toolbox.

1 comment

0

I've done this not to long ago, when I get home I well let you know if this question has not been answered yet.

2 answers

✓ Accepted answer

Have a weapon in lighting, and a brick with a clickdetector with this script in it:'

local part = script.Parent
local detector = part.ClickDetector
local weapon = game.Lighting.WeaponName
local debounce = false

detector.MouseClick:connect(function(player) 
if debounce == false then
local g = weapon:Clone()
g.Parent = player.Backpack
debounce = true
wait(2)
debounce = false
end)

If this does not work, PM me @Mowblow for more help

1 comment

0

bro gg u so good

Umm, this script might work for any tool really:

local sword = game.ReplicatedStorage.Sword --you can change sword to whatever name your tool is
local debounce = false

function giveTool()
if debounce == false then --not sure if denounce applies to click events, but idc
debounce = true

copy = sword:Clone()

copy.Parent = playerBackpack --this isn't the real player backpack, just find it through GetChildren because I'm not good with it

debounce = false

end

script.Parent.ClickDetector.MouseClick:connect(giveTool) --assuming script is in the part and there is a ClickDetector in there ;)

Made this in a school iPad and it's meant to be an example, not actual working code. Didn't get to test it out yet :P

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