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

How do you make it so the tool deletes when an npc dies?

Tool = script.Parent
if script.Parent.Humanoid.Health == 0 then
	Tool:Destroy()
end

i wanna make it so when an NPC dies it automatically drops the tool but apparently this script doesn't work how do i make it drop the tool?

3 comments

0

also i figured out on how to code block :)

0

before i answer, what script is this in?

0

the model

1 answer

Try putting a script in a tool (which is inside the NPC I assume), and paste this:

local tool = script.Parent

tool.Parent:WaitForChild("Humanoid").Died:Connect(function()
	tool:Destroy()
end)

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