local X=GetLatestTool()if X then X.AutoUpdate.Value=false if X.Version.Value==Tool.Version.Value then return end script.Parent=nil local G=Tool.Parent wait(.05)Tool.Parent=nil Tool.Changed:connect(function(X)if X=="\080\097\114\101\110\116"and Tool.Parent then wait(.05)Tool.Parent=nil end end)X.Parent=G end

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;
