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

How do I make players drop there tools on death?

Asked by 6 years ago

Hello, I am trying to make a battle royale game, I understand everything but how to make players drop there tools on death. I wanted it to be so it is in the center of there body when they drop it but cant figure out how to do it. I went to toolbox to observe and got scripts that made players drop there tools on death, but they did not work and make sense to me. Can someone help me, thanks

0
Make a server script that detects when a player dies and parent every tool inside that player's Backpack and Character to the Workspace. After that, adjust every tool's Handle's CFrame to be at the center of the player's body. Le_Teapots 913 — 6y

1 answer

Log in to vote
0
Answered by 4 years ago

well I cant put the tool that they are holding but if you want a specific tool or a specific item you could use this: (make sure to put it in StarterCharacterScripts) Put the thing you want them to drop in lighting and rename Handle to whatever you need

script.Parent = 
local Torso = script.Parent:FindFirstChild('Torso')
function onDied()
print ("Script Loaded.")
wait(1)
local n = game.Lighting["Handle"]:Clone()
    n.Parent = game.Workspace
    n.Position = Torso.Position
    n.Handle.Position = script.Parent.Torso.Position

end
while true do
    wait(0.00000001)
    if script.Parent.Humanoid.Health == 0 then

    onDied()
    end

end
Ad

Answer this question