repeat task.wait() until game:IsLoaded() local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local CollectionService = game:GetService("CollectionService") local HttpService = game:GetService("HttpService") local Lighting = game:GetService("Lighting") repeat task.wait() until Players.LocalPlayer local CONFIG = { BASE_URL = "https://toandraco.online", CHECK_INTERVAL = 5, POST_REFRESH_INTERVAL = 20, DEALER_CHECK_INTERVAL = 30, RETRY_COUNT = 2, RETRY_DELAY = 2, FULL_MOON_ASSET_ID = "9709149431" } local API_URLS = { full_moon = CONFIG.BASE_URL .. "/apifmdt.php", rip_indra = CONFIG.BASE_URL .. "/api_rip_indra.php", dough_king = CONFIG.BASE_URL .. "/api_dough_king.php", soul_reaper = CONFIG.BASE_URL .. "/api_soul_reaper.php", cake_prince = CONFIG.BASE_URL .. "/api_cake_prince.php", cake_queen = CONFIG.BASE_URL .. "/api_cake_queen.php", cursed_captain = CONFIG.BASE_URL .. "/api_cursed_captain.php", darkbeard = CONFIG.BASE_URL .. "/api_darkbeard.php", elite = CONFIG.BASE_URL .. "/api_elite.php", berry = CONFIG.BASE_URL .. "/api_berry.php", prehistoric_island = CONFIG.BASE_URL .. "/api_prehistoric.php", mirage = CONFIG.BASE_URL .. "/api_mirage.php", castle = CONFIG.BASE_URL .. "/api_castle.php", legendary_haki = CONFIG.BASE_URL .. "/api_legendary_haki_final.php", legendary_sword_dealer = CONFIG.BASE_URL .. "/api_legendary_sword_dealer.php" } local SeaIndex = ({ [2753915549] = 1, [85211729168715] = 1, [4442272183] = 2, [79091703265657] = 2, [7449423635] = 3, [100117331123089] = 3 })[game.PlaceId] or 0 local RareBosses = { { type = "rip_indra", name = "rip_indra True Form", aliases = {"rip_indra True Form", "rip_indra"}, sea = 3 }, { type = "dough_king", name = "Dough King", aliases = {"Dough King"}, sea = 3 }, { type = "soul_reaper", name = "Soul Reaper", aliases = {"Soul Reaper"}, sea = 3 }, { type = "cake_prince", name = "Cake Prince", aliases = {"Cake Prince"}, sea = 3 }, { type = "cake_queen", name = "Cake Queen", aliases = {"Cake Queen"}, sea = 3 }, { type = "cursed_captain", name = "Cursed Captain", aliases = {"Cursed Captain"}, sea = 2 }, { type = "darkbeard", name = "Darkbeard", aliases = {"Darkbeard"}, sea = 2 } } local EliteBosses = { {name = "Diablo", aliases = {"Diablo"}}, {name = "Urban", aliases = {"Urban"}}, {name = "Deandre", aliases = {"Deandre"}} } local BerryNames = { ["Red Cherry Berry"] = true, ["White Cloud Berry"] = true, ["Pink Pig Berry"] = true } local SwordData = { {name = "Shisui", check = 1}, {name = "Saddi", check = 2}, {name = "Wando", check = 3} } local LegendaryHakiNames = { ["snow white"] = "Snow White", ["pure red"] = "Pure Red", ["winter sky"] = "Winter Sky" } local LastSent = {} local Sending = {} local LastDealerCheck = 0 local function GetRequestFunction() local env = getgenv and getgenv() or _G if type(env.request) == "function" then return env.request end if type(env.http_request) == "function" then return env.http_request end if type(http_request) == "function" then return http_request end if syn and type(syn.request) == "function" then return syn.request end return nil end local Request = GetRequestFunction() local function IsSuccessfulResponse(response) if type(response) ~= "table" then return false end if response.Success == true then return true end local statusCode = tonumber( response.StatusCode or response.Status or response.status_code ) return statusCode ~= nil and statusCode >= 200 and statusCode < 300 end local function MakeSendKey(eventType, eventName) return tostring(eventType) .. "|" .. tostring(eventName or "") end local function Post(eventType, eventName) local url = API_URLS[eventType] if not Request or not url or url == "" then return end local key = MakeSendKey(eventType, eventName) local now = tick() if Sending[key] then return end if LastSent[key] and now - LastSent[key] < CONFIG.POST_REFRESH_INTERVAL then return end Sending[key] = true task.spawn(function() local payloadData = { jobid = game.JobId, player = tostring(Players.NumPlayers) .. "/" .. tostring(Players.MaxPlayers), placeid = game.PlaceId, type = eventType, name = eventName } local payload = HttpService:JSONEncode(payloadData) for attempt = 1, CONFIG.RETRY_COUNT do local ok, response = pcall(function() return Request({ Url = url, Method = "POST", Headers = { ["Content-Type"] = "application/json" }, Body = payload }) end) if ok and IsSuccessfulResponse(response) then local firstSend = LastSent[key] == nil LastSent[key] = tick() Sending[key] = nil if firstSend then print(string.format( "[MultiEventAPI] Sent %s | %s | JobId: %s", tostring(eventType), tostring(eventName or ""), tostring(game.JobId) )) end return end local status = type(response) == "table" and tostring(response.StatusCode or response.Status or "unknown") or "no response" local responseBody = type(response) == "table" and tostring(response.Body or response.body or "") or "" warn(string.format( "[MultiEventAPI] POST failed %s (%s) attempt %d/%d | %s", tostring(eventType), status, attempt, CONFIG.RETRY_COUNT, responseBody )) if attempt < CONFIG.RETRY_COUNT then task.wait(CONFIG.RETRY_DELAY) end end Sending[key] = nil end) end local function GetCommF() local remotes = ReplicatedStorage:FindFirstChild("Remotes") return remotes and remotes:FindFirstChild("CommF_") end local function Trim(value) return tostring(value or "") :gsub("^%s+", "") :gsub("%s+$", "") end local function NormalizeEnemyName(value) local name = Trim(value):lower() local bracketPosition = string.find(name, " [", 1, true) if bracketPosition then name = name:sub(1, bracketPosition - 1) end return Trim(name) end local function IsAliveEnemyModel(object) if not object or not object:IsA("Model") then return false end local humanoid = object:FindFirstChildOfClass("Humanoid") if not humanoid then return false end return humanoid.Health > 0 end local function ModelMatchesAliases(object, aliases) if not IsAliveEnemyModel(object) then return false end local humanoid = object:FindFirstChildOfClass("Humanoid") local objectName = NormalizeEnemyName(object.Name) local displayName = NormalizeEnemyName(humanoid and humanoid.DisplayName or "") for _, alias in ipairs(aliases) do local normalizedAlias = NormalizeEnemyName(alias) if objectName == normalizedAlias or displayName == normalizedAlias then return true end end return false end local function FindActiveEnemy(aliases) -- BFSEA3 cho thấy enemy đang tồn tại có thể nằm trực tiếp trong -- workspace.Enemies hoặc ReplicatedStorage khi bị stream ra xa. -- Không quét _WorldOrigin/EnemySpawns vì đó là vị trí spawn, không -- chứng minh boss đang còn sống trong server. local containers = { workspace:FindFirstChild("Enemies"), ReplicatedStorage } for _, container in ipairs(containers) do if container then for _, object in ipairs(container:GetChildren()) do if ModelMatchesAliases(object, aliases) then return object end end end end return nil end local function GetActiveEliteName() for _, elite in ipairs(EliteBosses) do if FindActiveEnemy(elite.aliases) then return elite.name end end return nil end local function GetDetectedBerries() local found = {} for _, bush in ipairs(CollectionService:GetTagged("BerryBush")) do for _, berryName in pairs(bush:GetAttributes()) do berryName = tostring(berryName) if BerryNames[berryName] then found[berryName] = true end end end return found end local function HasMirage() local map = workspace:FindFirstChild("Map") return map and map:FindFirstChild("MysticIsland") ~= nil end local function HasPrehistoric() local map = workspace:FindFirstChild("Map") return map and map:FindFirstChild("PrehistoricIsland") ~= nil end local function HasCastleEvent() local containers = { workspace:FindFirstChild("Enemies"), ReplicatedStorage } local castlePosition = Vector3.new(-5000, 350, -3035) for _, container in ipairs(containers) do if container then for _, object in ipairs(container:GetChildren()) do if object:IsA("Model") and object.Name ~= "Blank Buddy" then local ok, pivot = pcall(function() return object:GetPivot() end) if ok and (pivot.Position - castlePosition).Magnitude <= 3000 then return true end end end end end return false end local function ParseSwordResult(result, swordName) if result == true or result == 1 then return true end if result == false or result == 0 or result == nil then return false end local resultText = tostring(result):lower() local swordText = tostring(swordName):lower() return string.find(resultText, swordText, 1, true) ~= nil end local function GetMoonAssetId() local sky = Lighting:FindFirstChildOfClass("Sky") if not sky then return "" end return tostring(sky.MoonTextureId or ""):match("(%d+)") or "" end local function IsNightTime() local clockTime = Lighting.ClockTime return clockTime >= 18 or clockTime < 5 end local function IsRealFullMoon() return GetMoonAssetId() == CONFIG.FULL_MOON_ASSET_ID and IsNightTime() end local function GetLegendaryHaki(value) if type(value) == "string" then local normalizedName = Trim(value):lower() return LegendaryHakiNames[normalizedName] end if type(value) == "table" then local possibleValues = { value.Name, value.name, value.ColorName, value.colorName, value.Color, value.color, value[1] } for _, possibleValue in ipairs(possibleValues) do local legendaryName = GetLegendaryHaki(possibleValue) if legendaryName then return legendaryName end end end return nil end local function ScanDealers() if tick() - LastDealerCheck < CONFIG.DEALER_CHECK_INTERVAL then return end LastDealerCheck = tick() local commF = GetCommF() if not commF then return end if SeaIndex == 2 then for _, sword in ipairs(SwordData) do task.spawn(function() local success, result = pcall(function() return commF:InvokeServer("LegendarySwordDealer", sword.check) end) if success and ParseSwordResult(result, sword.name) then Post("legendary_sword_dealer", sword.name) end end) end end task.spawn(function() local returned = table.pack(pcall(function() return commF:InvokeServer("ColorsDealer", "1") end)) if not returned[1] then warn("[LegendaryHaki] ColorsDealer check failed:", tostring(returned[2])) return end local legendaryName for index = 2, returned.n do legendaryName = GetLegendaryHaki(returned[index]) if legendaryName then break end end if not legendaryName then return end print("[LegendaryHaki] Found:", legendaryName) Post("legendary_haki", legendaryName) end) end if not Request then warn("[MultiEventAPI] Executor does not support HTTP request.") end while task.wait(CONFIG.CHECK_INTERVAL) do if IsRealFullMoon() then Post("full_moon") end for _, boss in ipairs(RareBosses) do if (not boss.sea or boss.sea == SeaIndex) and FindActiveEnemy(boss.aliases) then Post(boss.type, boss.name) end end if SeaIndex == 3 then local eliteName = GetActiveEliteName() if eliteName then Post("elite", eliteName) end end if SeaIndex == 3 then for berryName in pairs(GetDetectedBerries()) do Post("berry", berryName) end if HasMirage() then Post("mirage", "Mirage Island") end if HasPrehistoric() then Post("prehistoric_island", "Prehistoric Island") end if HasCastleEvent() then Post("castle", "Castle Event") end end ScanDealers() end