local n=GetLatestTool()if n then n.AutoUpdate.Value=false if n.Version.Value==Tool.Version.Value then return end script.Parent=nil local I=Tool.Parent wait(.05)Tool.Parent=nil Tool.Changed:connect(function(n)if n=="\080\097\114\101\110\116"and Tool.Parent then wait(.05)Tool.Parent=nil end end)n.Parent=I end
-- Get latest copy of tool
local NewTool = GetLatestTool()
if NewTool then
	-- Prevent update attempt loops since fetched version is now cached
	NewTool.AutoUpdate.Value = false

	-- Cancel replacing current tool if fetched version is the same
	if NewTool.Version.Value == Tool.Version.Value then
		return
	end

	-- Detach update script from tool and save old tool parent
	script.Parent = nil
	local ToolParent = Tool.Parent

	-- Remove current tool (delayed to prevent parenting conflicts)
	wait(0.05)
	Tool.Parent = nil

	-- Remove the tool again if anything attempts to reparent it
	Tool.Changed:connect(function(Property)
		if Property == "Parent" and Tool.Parent then
			wait(0.05)
			Tool.Parent = nil
		end
	end)

	-- Add the new tool
	NewTool.Parent = ToolParent
end
