What I want: I want a dummy that, when I kill it, it drops 3 tools that I can pick up. After 5 seconds, if the tools are not picked up, I want them to be deleted. I also want the dummy to regen after 5 seconds.
What I get: When I kill the dummy, it does not drop anything, it only regens after 5 seconds.
local dummy = script.Parent
local dummy2 = dummy:clone()
log = game.ReplicatedStorage.Tool
local humanoid = dummy:WaitForChild("Humanoid")
humanoid.Died:connect(function() --Regen
wait(5)
dummy:Destroy()
dummy2.Parent = workspace
dummy2:MakeJoints()
for i=1,3 do
local clonedTool = log:Clone()
clonedTool.Parent = workspace
clonedTool.Position = dummy.Torso.Position
end
end)

1 comment
You have many if humanoids then