--[[ fix_dupes.luau -- remove leftover CarManager clones and report the truth. diag_stale found TWO ModuleScripts at ServerScriptService.Server.CarManager, both len=30631 with no _buildForDiag, while the file on disk is 39591 bytes and defines it. My diagnostic scripts cloned the module and did not always destroy the clone, so duplicates accumulated; require() may bind to either. Deletes every CarManager except the one that is a genuine child of the Server folder (keeping the first by index), then reports what remains so the next push has a single unambiguous target. ]] local ServerScriptService = game:GetService("ServerScriptService") local out = {} local function log(...) local parts = {} for i = 1, select("#", ...) do parts[#parts + 1] = tostring((select(i, ...))) end table.insert(out, table.concat(parts, " ")) end local server = ServerScriptService:FindFirstChild("Server", true) if not server then return "no Server folder" end local mods = {} for _, d in ipairs(ServerScriptService:GetDescendants()) do if d:IsA("ModuleScript") and d.Name == "CarManager" then mods[#mods + 1] = d end end log(string.format("found %d CarManager module(s)", #mods)) for i, m in ipairs(mods) do local len = "?" pcall(function() len = tostring(#m.Source) end) log( string.format( " [%d] %s len=%s parent=%s", i, m:GetFullName(), len, m.Parent and m.Parent:GetFullName() or "nil" ) ) end -- Keep exactly one: prefer a direct child of the Server folder. local keep = nil for _, m in ipairs(mods) do if m.Parent == server then keep = m break end end keep = keep or mods[1] local removed = 0 for _, m in ipairs(mods) do if m ~= keep then m:Destroy() removed += 1 end end log("") log(string.format("kept: %s", keep and keep:GetFullName() or "nil")) log(string.format("removed: %d duplicate(s)", removed)) -- Confirm the survivor local after = 0 for _, d in ipairs(ServerScriptService:GetDescendants()) do if d:IsA("ModuleScript") and d.Name == "CarManager" then after += 1 end end log(string.format("remaining CarManager count: %d", after)) if keep then local len = "?" pcall(function() len = tostring(#keep.Source) end) log("survivor source length: " .. len .. " (disk file is 39591)") end return table.concat(out, "\n")