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

How do I make it so that when I kill a humanoid, it drops 3 tools?

Asked by 8 years ago

I want to make a script that drops 3 copies of the SAME tool when I kill the humanoid. Problem: The dummy is not dropping the 3 tools I want it to.

01local dummy = script.Parent
02local dummy2 = dummy:clone()
03backup = dummy
04log = game.ReplicatedStorage.Tool
05 
06 
07local humanoid = backup:FindFirstChild("Humanoid")
08 
09if humanoid then
10    humanoid.Died:connect(function()
11        wait(5)
12        dummy:Destroy()
13        dummy2.Parent = workspace
14        dummy2:MakeJoints()
15        log:Clone()
16        log:Clone()
17        log:Clone()
18    end)
19end

2 answers

Log in to vote
1
Answered by 8 years ago
Edited 8 years ago

You could use a loop to spawn multiple tools. You also need to set the tool's parent to workspace, and set its starting position to see it. For example, I set the tool's starting position to the dummy's torso position.

01local dummy = script.Parent
02local dummy2 = dummy:clone()
03backup = dummy
04log = game.ReplicatedStorage.Tool
05 
06 
07local humanoid = backup:FindFirstChild("Humanoid")
08 
09if humanoid then
10    humanoid.Died:connect(function()
11        wait(5)
12        dummy:Destroy()
13        dummy2.Parent = workspace
14        dummy2:MakeJoints()
15    for i=1,3 do
View all 21 lines...
0
Thanks, it worked! :) ReynaldoVictarion 70 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

an easier way to do it is by going to linkedsword and check can drop weapon

Answer this question