I'm making a tool that takes the items from the players backpack upon death and stores it in a folder inside another tool. I got the spawning down but for some reason the items won't transfer into the tools folder. For now I am using swords and guns but my tools aren't gonna have any bricks so the workspace won't be an issue...
First I tried
local humanoid = script.Parent:WaitForChild("Humanoid")
local hrp = script.Parent:WaitForChild("HumanoidRootPart")
local plr = game.Players:FindFirstChild(script.Parent.Name)
humanoid.Died:Connect(function()
local clone = game.Lighting.Tools.Runes:FindFirstChild('Skill Rune'):Clone()
clone.Parent = workspace
clone.Handle.Position = hrp.Position + Vector3.new(math.random(-5,5), 0, math.random(-5,5))
local plrskills = plr.Backpack:GetChildren()
plrskills.Parent = clone.Skills
end)
Then I tried
local humanoid = script.Parent:WaitForChild("Humanoid")
local hrp = script.Parent:WaitForChild("HumanoidRootPart") -- this is assuming the npc model has a Torso
local plrn = script.Parent.Name
local plr = game.Players:FindFirstChild(plrn)
humanoid.Died:Connect(function()
local clone = game.Lighting.Tools.Runes:FindFirstChild('Skill Rune'):Clone()
clone.Parent = workspace
clone.Handle.Position = hrp.Position + Vector3.new(math.random(-5,5), 0, math.random(-5,5))
local plrskills = plr.Backpack:GetChildren()
for _,v in pairs(plrskills) do
if v:IsA("Tool") then
v.Parent = clone:FindFirstChild('Skills')
end
end
end)
Both do not function correctly, or at all actually!

1 comment
Ok, first of all, use indentation properly. Secondly, why are you using Lighting to store stuff?! Use ServerStorage or ReplicatedStorage. Next, set all the properties of an object before parenting it. Lastly, keep in mind that tools can be found in two places; the character if they are equipped, or the backpack if they are not. Also, use CFrame, not Vector3, as that can cause some issues.