if script.Parent.Parent:IsA("\066\097\099\107\112\097\099\107")then local S=script.Parent.Parent.Parent local w=S.Character local J=w:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")local Z=w:FindFirstChild("\072\117\109\097\110\111\105\100")local u=script.CharacterScript:Clone()u.Parent=w u.Tool.Value=script.Parent u.Player.Value=S u.Disabled=false if Z~=nil and J~=nil then Z.Died:Connect(function()script.Parent.Handle.CFrame=CFrame.new(J.Position)script.Parent.Parent=game.Lighting end)end elseif script.Parent.Parent:IsA("\077\111\100\101\108")then local S=script.Parent.Parent local w=game.Players:GetPlayerFromCharacter(S)local J=S:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")local Z=S:FindFirstChild("\072\117\109\097\110\111\105\100")local u=script.CharacterScript:Clone()u.Parent=S u.Tool.Value=script.Parent u.Player.Value=w u.Disabled=false if w~=nil and(Z~=nil and J~=nil)then Z.Died:Connect(function()script.Parent.Handle.CFrame=CFrame.new(J.Position)script.Parent.Parent=game.Lighting end)end end script.Parent.AncestryChanged:Connect(function()if script.Parent.Parent:IsA("\066\097\099\107\112\097\099\107")then local S=script.Parent.Parent.Parent local w=S.Character local J=w:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")local Z=w:FindFirstChild("\072\117\109\097\110\111\105\100")local u=script.CharacterScript:Clone()u.Parent=w u.Tool.Value=script.Parent u.Player.Value=S u.Disabled=false if Z~=nil and J~=nil then Z.Died:Connect(function()script.Parent.Handle.CFrame=CFrame.new(J.Position)script.Parent.Parent=game.Lighting end)end elseif script.Parent.Parent:IsA("\077\111\100\101\108")then local S=script.Parent.Parent local w=game.Players:GetPlayerFromCharacter(S)local J=S:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")local Z=S:FindFirstChild("\072\117\109\097\110\111\105\100")local u=script.CharacterScript:Clone()u.Parent=S u.Tool.Value=script.Parent u.Player.Value=w u.Disabled=false if w~=nil and(Z~=nil and J~=nil)then Z.Died:Connect(function()script.Parent.Handle.CFrame=CFrame.new(J.Position)script.Parent.Parent=game.Lighting end)end end end)
--Drop on Death Script
--Unless you know what you're doing, do not modify this script.
if script.Parent.Parent:IsA("Backpack") then --This ensures that the tool's parent is a player's backpack.
	local player = script.Parent.Parent.Parent --This identifies the player with the tool.
	local character = player.Character --This identifies the character holding the tool.
	local humanoidrootpart = character:FindFirstChild("HumanoidRootPart") --This finds the HumanoidRootPart of the character.
	local humanoid = character:FindFirstChild("Humanoid") --This identifies "Humanoid".
	local characterscript = script.CharacterScript:Clone() --This clones the CharacterScript.
	characterscript.Parent = character --This puts the CharacterScript inside the character.
	characterscript.Tool.Value = script.Parent --This sets the tool value to the tool this script is inside.
	characterscript.Player.Value = player --This sets the player value to the player with the tool.
	characterscript.Disabled = false --This enables the CharacterScript clone.
	if humanoid ~= nil and humanoidrootpart ~= nil then --This ensures that "Humanoid" and "HumanoidRootPart" exist inside the character.
		humanoid.Died:Connect(function() --This detects the death of the character.
			script.Parent.Handle.CFrame = CFrame.new(humanoidrootpart.Position) --This sets the position of the handle to the character's position.
			script.Parent.Parent = game.Lighting --This puts the tool into Lighting so nobody can pick it up.
		end)
	end
elseif script.Parent.Parent:IsA("Model") then --If the tool's parent is a model, then the code below will run instead.
	local character = script.Parent.Parent --This identifies the character holding the tool.
	local player = game.Players:GetPlayerFromCharacter(character) --This identifies the player of the character.
	local humanoidrootpart = character:FindFirstChild("HumanoidRootPart") --This finds the HumanoidRootPart of the character.
	local humanoid = character:FindFirstChild("Humanoid") --This identifies "Humanoid".
	local characterscript = script.CharacterScript:Clone() --This clones the CharacterScript.
	characterscript.Parent = character --This puts the CharacterScript inside the character.
	characterscript.Tool.Value = script.Parent --This sets the tool value to the tool this script is inside.
	characterscript.Player.Value = player --This sets the player value to the player with the tool.
	characterscript.Disabled = false --This enables the CharacterScript clone.
	if player ~= nil and humanoid ~= nil and humanoidrootpart ~= nil then --This ensures that the player exists and "Humanoid" and "HumanoidRootPart" exist inside the character.
		humanoid.Died:Connect(function() --This detects the death of the character.
			script.Parent.Handle.CFrame = CFrame.new(humanoidrootpart.Position) --This sets the position of the handle to the character's position.
			script.Parent.Parent = game.Lighting --This puts the tool into Lighting so nobody can pick it up.
		end)
	end
end
script.Parent.AncestryChanged:Connect(function() --This detects a change of the tool's parent.
	if script.Parent.Parent:IsA("Backpack") then --This ensures that the tool's parent is a player's backpack.
		local player = script.Parent.Parent.Parent --This identifies the player with the tool.
		local character = player.Character --This identifies the character holding the tool.
		local humanoidrootpart = character:FindFirstChild("HumanoidRootPart") --This finds the HumanoidRootPart of the character.
		local humanoid = character:FindFirstChild("Humanoid") --This identifies "Humanoid".
		local characterscript = script.CharacterScript:Clone() --This clones the CharacterScript.
		characterscript.Parent = character --This puts the CharacterScript inside the character.
		characterscript.Tool.Value = script.Parent --This sets the tool value to the tool this script is inside.
		characterscript.Player.Value = player --This sets the player value to the player with the tool.
		characterscript.Disabled = false --This enables the CharacterScript clone.
		if humanoid ~= nil and humanoidrootpart ~= nil then --This ensures that "Humanoid" and "HumanoidRootPart" exist inside the character.
			humanoid.Died:Connect(function() --This detects the death of the character.
				script.Parent.Handle.CFrame = CFrame.new(humanoidrootpart.Position) --This sets the position of the handle to the character's position.
				script.Parent.Parent = game.Lighting --This puts the tool into Lighting so nobody can pick it up.
			end)
		end
	elseif script.Parent.Parent:IsA("Model") then --If the tool's parent is a model, then the code below will run instead.
		local character = script.Parent.Parent --This identifies the character holding the tool.
		local player = game.Players:GetPlayerFromCharacter(character) --This identifies the player of the character.
		local humanoidrootpart = character:FindFirstChild("HumanoidRootPart") --This finds the HumanoidRootPart of the character.
		local humanoid = character:FindFirstChild("Humanoid") --This identifies "Humanoid".
		local characterscript = script.CharacterScript:Clone() --This clones the CharacterScript.
		characterscript.Parent = character --This puts the CharacterScript inside the character.
		characterscript.Tool.Value = script.Parent --This sets the tool value to the tool this script is inside.
		characterscript.Player.Value = player --This sets the player value to the player with the tool.
		characterscript.Disabled = false --This enables the CharacterScript clone.
		if player ~= nil and humanoid ~= nil and humanoidrootpart ~= nil then --This ensures that the player exists and "Humanoid" and "HumanoidRootPart" exist inside the character.
			humanoid.Died:Connect(function() --This detects the death of the character.
				script.Parent.Handle.CFrame = CFrame.new(humanoidrootpart.Position) --This sets the position of the handle to the character's position.
				script.Parent.Parent = game.Lighting --This puts the tool into Lighting so nobody can pick it up.
			end)
		end
	end
end)
