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

how do i make when people die they drop all there tools?

how do i make when people die they drop all there tools?

also when drop tools i want to be able to pick it up when i click on them or just step on them

thanks for reading not much but small

1 answer

✓ Accepted answer

Put this in a server script service

Make a script.

Code:

game.Players.PlayerAdded:connect(function(Player) -- use the PlayerAdded event to get the Player
 Player.CharacterAdded:connect(function(Character) -- use the CharacterAdded event to get the character
 local hum = Character:FindFirstChild("Humanoid") -- get the Humanoid
 local torso = Character:FindFirstChild("Torso") -- get the torso
hum.Died:connect(function() -- when the Humanoid.Health = 0
 for I, tool in pairs(Player.Backpack:GetChildren()) do
  tool.Handle.Position = CFrame.new(torso.Position.X + math.random(0, 5), torso.Position.Y + math.random(0,5), torso.Position.Z + math.random(0,5)) -- places them near Players position
 tool.Parent = Workspace -- adds the tool to the workspace
 end
end)
 end)
end)

1 comment

0

fixed it btw...

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