-- === GIỮ NGUYÊN ĐOẠN ĐẦU CỦA BẠN (KHÔNG THAY ĐỔI) === local remote, idremote for _, v in next, ({game.ReplicatedStorage.Util, game.ReplicatedStorage.Common, game.ReplicatedStorage.Remotes, game.ReplicatedStorage.Assets, game.ReplicatedStorage.FX}) do for _, n in next, v:GetChildren() do if n:IsA("RemoteEvent") and n:GetAttribute("Id") then remote, idremote = n, n:GetAttribute("Id") end end v.ChildAdded:Connect(function(n) if n:IsA("RemoteEvent") and n:GetAttribute("Id") then remote, idremote = n, n:GetAttribute("Id") end end) end -- === END (không đổi) === -- START: Auto Elite + Server Hop (fix) local HttpService = game:GetService("HttpService") local TeleportService = game:GetService("TeleportService") local Players = game:GetService("Players") local plr = Players.LocalPlayer _G.AutoElite = _G.AutoElite or false _G.StopWhenChalice = (_G.StopWhenChalice == nil) and true or _G.StopWhenChalice local VisitedServers = {} -- chỉ session hiện tại -- Skip hiện tại VisitedServers[game.JobId] = true -- help vars local function HasChalice() local suc, res = pcall(function() return GetBP and (GetBP("God's Chalice") or GetBP("Sweet Chalice") or GetBP("Fist of Darkness")) end) return suc and res or false end local function GetEnemiesFolder() return workspace:FindFirstChild("Enemies") or workspace:FindFirstChild("Monsters") or workspace end -- Tìm elite trong map local function FindElite() local Enemies = GetEnemiesFolder() for _, mob in ipairs(Enemies:GetChildren()) do local hum = mob:FindFirstChild("Humanoid") if hum and hum.Health > 0 then local name = mob.Name or "" if string.find(name, "Diablo") or string.find(name, "Urban") or string.find(name, "Deandre") then return mob end end end return nil end -- Hop server (không trùng trong VisitedServers, bỏ current job) local function HopServer() if _G.StopWhenChalice and HasChalice() then warn("[AutoElite] Có Chalice -> không hop server.") return end local ok, body = pcall(function() return game:HttpGet("https://games.roblox.com/v1/games/"..tostring(game.PlaceId).."/servers/Public?sortOrder=Asc&limit=100") end) if not ok or not body then warn("[AutoElite] Lấy server list thất bại.") return end local data = nil local success, decoded = pcall(function() return HttpService:JSONDecode(body) end) if success then data = decoded end if not data or not data.data then warn("[AutoElite] JSON server list không hợp lệ.") return end local candidates = {} for _, v in ipairs(data.data) do if type(v.id) == "string" and v.id ~= game.JobId and (v.playing < v.maxPlayers) and not VisitedServers[v.id] then table.insert(candidates, v) end end -- Nếu không đủ trong trang 1, thử vài trang tiếp theo (nếu có) local cursor = data.nextPageCursor local tries = 0 while #candidates == 0 and cursor and tries < 3 do tries = tries + 1 local url = "https://games.roblox.com/v1/games/"..tostring(game.PlaceId).."/servers/Public?sortOrder=Asc&limit=100&cursor="..tostring(cursor) local ok2, body2 = pcall(function() return game:HttpGet(url) end) if not ok2 then break end local suc2, dec2 = pcall(function() return HttpService:JSONDecode(body2) end) if not suc2 or not dec2 or not dec2.data then break end for _, v in ipairs(dec2.data) do if type(v.id) == "string" and v.id ~= game.JobId and (v.playing < v.maxPlayers) and not VisitedServers[v.id] then table.insert(candidates, v) end end cursor = dec2.nextPageCursor end if #candidates == 0 then warn("[AutoElite] Không tìm thấy server phù hợp, thử lại sau.") return end local pick = candidates[math.random(1, #candidates)] if pick and pick.id then VisitedServers[pick.id] = true warn("[AutoElite] Đang chuyển server -> "..tostring(pick.id)) -- Teleport pcall(function() TeleportService:TeleportToPlaceInstance(game.PlaceId, pick.id, plr) end) end end -- Kill Aura chỉ cho Elite (không dùng 'continue') task.spawn(function() math.randomseed(tick()) while true do task.wait(0.05) if _G.AutoElite then local char = plr.Character local root = char and char:FindFirstChild("HumanoidRootPart") if char and root then local parts = {} local Enemies = GetEnemiesFolder() for _, mob in ipairs(Enemies:GetChildren()) do local hrp = mob:FindFirstChild("HumanoidRootPart") local hum = mob:FindFirstChild("Humanoid") if hrp and hum and hum.Health > 0 then local name = mob.Name or "" if (string.find(name,"Diablo") or string.find(name,"Urban") or string.find(name,"Deandre")) and (hrp.Position - root.Position).Magnitude <= 60 then for _, bp in ipairs(mob:GetChildren()) do if bp:IsA("BasePart") then table.insert(parts, {mob, bp}) end end end end end local tool = char:FindFirstChildOfClass("Tool") if #parts > 0 and tool and (tool:GetAttribute and (tool:GetAttribute("WeaponType") == "Melee" or tool:GetAttribute("WeaponType") == "Sword")) then pcall(function() -- try prepare remote calls safely local netMod = game:GetService("ReplicatedStorage"):FindFirstChild("Modules") and game.ReplicatedStorage.Modules.Net if netMod then pcall(function() require(game.ReplicatedStorage.Modules.Net):RemoteEvent("RegisterHit", true) end) pcall(function() game.ReplicatedStorage.Modules.Net["RE/RegisterAttack"]:FireServer() end) end local target = parts[1][1] local head = target and (target:FindFirstChild("Head") or parts[1][2]) if not head then return end pcall(function() if netMod and netMod["RE/RegisterHit"] then netMod["RE/RegisterHit"]:FireServer(head, parts, {}, tostring(plr.UserId):sub(2,4) .. tostring(math.random(1000,9999))) end end) local fireRemote = (cloneref and cloneref(remote)) or remote if fireRemote and idremote then local encName = string.gsub("RE/RegisterHit", ".", function(c) return string.char(bit32.bxor(string.byte(c), math.floor(workspace:GetServerTimeNow() / 10 % 10) + 1)) end) local okSeed, seedVal = pcall(function() return game.ReplicatedStorage.Modules.Net.seed:InvokeServer() end) local hashed = nil if okSeed and type(seedVal) == "number" then hashed = bit32.bxor(idremote + 909090, seedVal * 2) else hashed = bit32.bxor(idremote + 909090, 12345) end pcall(function() fireRemote:FireServer(encName, hashed, head, parts) end) end end) end end end end end) -- Main loop: check elite, nhận quest, hop nếu ko có task.spawn(function() while true do task.wait(1.5) pcall(function() if not _G.AutoElite then -- không bật -> lặp lại else if _G.StopWhenChalice and HasChalice() then warn("[AutoElite] Phát hiện Chalice -> dừng AutoElite.") _G.AutoElite = false else local elite = FindElite() if elite then -- nếu chưa có quest thì nhận local hasQuest = false local suc, res = pcall(function() if plr.PlayerGui and plr.PlayerGui.Main and plr.PlayerGui.Main.Quest then return plr.PlayerGui.Main.Quest.Visible end return false end) hasQuest = suc and res if not hasQuest then pcall(function() replicated.Remotes.CommF_:InvokeServer("EliteHunter") end) task.wait(0.7) end -- teleport lên đầu boss để kill (Kill Aura sẽ tấn công) if elite and elite:FindFirstChild("HumanoidRootPart") then pcall(function() if _tp then _tp(elite.HumanoidRootPart.CFrame * CFrame.new(0, 20, 0)) else plr.Character:SetPrimaryPartCFrame(elite.HumanoidRootPart.CFrame * CFrame.new(0,20,0)) end end) end -- đợi boss chết hoặc trạng thái thay đổi local timeout = 0 while true do task.wait(0.8) timeout = timeout + 0.8 if not _G.AutoElite then break end if not elite or not elite.Parent then break end local ok, hp = pcall(function() return elite:FindFirstChild("Humanoid") and elite.Humanoid.Health end) if not ok or (hp and hp <= 0) then break end if timeout > 300 then break end -- an toàn end else -- không có elite -> hop server HopServer() task.wait(2) end end end end) end end) -- UI toggles (nếu bạn đang dùng Tabs.Quests như trước) if Tabs and Tabs.Quests and Tabs.Quests.AddToggle then local Q = Tabs.Quests:AddToggle("AutoElite", {Title = "Auto Elite Hunter (Hop Server)", Default = _G.AutoElite}) Q:OnChanged(function(Value) _G.AutoElite = Value end) local C = Tabs.Quests:AddToggle("StopChalice", {Title = "Stop when got God's Chalice", Default = _G.StopWhenChalice}) C:OnChanged(function(Value) _G.StopWhenChalice = Value end) else print("[AutoElite] UI toggle not found; sử dụng _G.AutoElite = true để bật.") end