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

How do you make a tool-giver?

Asked by 11 years ago

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.

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. IntellectualBeing 430 — 11y

2 answers

Log in to vote
2
Answered by
Mowblow 117
11 years ago

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

01local part = script.Parent
02local detector = part.ClickDetector
03local weapon = game.Lighting.WeaponName
04local debounce = false
05 
06detector.MouseClick:connect(function(player)
07if debounce == false then
08local g = weapon:Clone()
09g.Parent = player.Backpack
10debounce = true
11wait(2)
12debounce = false
13end)

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

0
bro gg u so good LUCATIVIOMAD 31 — 5y
Ad
Log in to vote
1
Answered by
OniiCh_n 410 Moderation Voter
11 years ago

Umm, this script might work for any tool really:

01local sword = game.ReplicatedStorage.Sword --you can change sword to whatever name your tool is
02local debounce = false
03 
04function giveTool()
05if debounce == false then --not sure if denounce applies to click events, but idc
06debounce = true
07 
08copy = sword:Clone()
09 
10copy.Parent = playerBackpack --this isn't the real player backpack, just find it through GetChildren because I'm not good with it
11 
12debounce = false
13 
14end
15 
16script.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

Answer this question