local player = game:GetService("Players").LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local root = character:WaitForChild("HumanoidRootPart") local function getRankedClusters() local allDabux = {} local clusters = {} -- 1. Scan the map for Dabux for _, obj in pairs(workspace:GetDescendants()) do if obj.Name == "Dabux" then local part = obj:IsA("BasePart") and obj or obj:FindFirstChildWhichIsA("BasePart") if part then table.insert(allDabux, part) end end end -- 2. Group by density (30 stud radius) for _, primary in pairs(allDabux) do local neighbors = 0 for _, secondary in pairs(allDabux) do if (primary.Position - secondary.Position).Magnitude <= 30 then neighbors = neighbors + 1 end end table.insert(clusters, {cf = primary.CFrame, count = neighbors}) end -- 3. Rank them table.sort(clusters, function(a, b) return a.count > b.count end) return clusters end -- PHASE 1: THE BIGGEST PILE local rankedList = getRankedClusters() if #rankedList >= 1 then local first = rankedList[1] print("Teleporting to #1 Cluster (" .. first.count .. " Dabux within 30 studs)") root.CFrame = first.cf * CFrame.new(0, 3, 0) -- PHASE 2: THE 40-SECOND WAIT print("Teleported. Staying here for 40 seconds...") task.wait(40) -- PHASE 3: THE SECOND BIGGEST PILE rankedList = getRankedClusters() if #rankedList >= 2 then local second = rankedList[2] print("Moving to #2 Cluster (" .. second.count .. " Dabux within 30 studs)") root.CFrame = second.cf * CFrame.new(0, 3, 0) print("Finished. Enjoy your Dabux.") else print("No second cluster found.") end else print("No Dabux found on the map.") end