--Character Script
--Unless you know what you're doing, do not modify this script.

local tool = script.Tool.Value --This identifies the tool to perform actions on.
local player = script.Player.Value --This identifies the player of the character this script is inside.
if player ~= nil then --This ensures that the player exists.
	local humanoidrootpart = script.Parent:WaitForChild("HumanoidRootPart") --This identifies the HumanoidRootPart inside the character.
	player.CharacterRemoving:Connect(function() --This detects the removal of the character.
		tool.Handle.CFrame = CFrame.new(humanoidrootpart.Position) --This sets the position of the handle to the character's position.
		tool.Parent = workspace --This puts the tool into Workspace, allowing players to pick it up.
	end)
else --If the player doesn't exist, the following code will run instead.
	script:Destroy() --This removes this script.
end
