I would like to know how to do this script
Inside the NPC add a server script not a local script and put your tool you want it to drop inside replicated storage then write this script.
local PlayerGivenTool = nil function onTouched(hit) if hit.Parent.ClassName == "Model" then PlayerGivenTool = hit.Parent end end script.Parent.Humanoid.Died:Connect(function() if PlayerGivenTool ~= nil then --Change Tool to your tool inside replicatedstorage game.ReplicatedStorage.Tool:Clone().Parent = PlayerGivenTool end end) script.Parent.HumanoidRootPart.Touched:Connect(onTouched) script.Parent.Head.Touched:Connect(onTouched) script.Parent.RightLowerArm.Touched:Connect(onTouched) script.Parent.LeftLowerArm.Touched:Connect(onTouched) script.Parent.RightLowerLeg.Touched:Connect(onTouched) script.Parent.LeftLowerLeg.Touched:Connect(onTouched)
Closed as Not Constructive by cmgtotalyawesome, pidgey, Igoralexeymarengobr, and OnaKat
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?