local BGS_SAVE_FOLDER = "BGSByYamahaoV13" local S = {GLOBAL = {}} local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local RunService = game:GetService("RunService") local Workspace = game:GetService("Workspace") local ReplicatedStorage = game:GetService("ReplicatedStorage") local Lighting = game:GetService("Lighting") local SoundService = game:GetService("SoundService") local Stats = game:GetService("Stats") local VirtualUser = game:GetService("VirtualUser") local TweenService = game:GetService("TweenService") local HttpService = game:GetService("HttpService") local TextChatService = game:GetService("TextChatService") local player = Players.LocalPlayer player.Idled:Connect(function() VirtualUser:CaptureController() VirtualUser:ClickButton2(Vector2.new(0, 0)) end) S.HAS_HOOK = (type(getconnections) == "function" and type(hookfunction) == "function") S.HAS_HTTP = false S.HTTP_MODE = nil if type(request) == "function" then S.HAS_HTTP, S.HTTP_MODE = true, "request" elseif type(http_request) == "function" then S.HAS_HTTP, S.HTTP_MODE = true, "http_request" elseif type(syn) == "table" and type(syn.request) == "function" then S.HAS_HTTP, S.HTTP_MODE = true, "syn" end S.HAS_FILE = (type(writefile) == "function" and type(readfile) == "function" and type(isfolder) == "function" and type(makefolder) == "function") function S.httpPost(url, body) if not S.HAS_HTTP then return nil end local payload = HttpService:JSONEncode(body) local headers = {["Content-Type"] = "application/json"} local ok, res = pcall(function() if S.HTTP_MODE == "request" then return request({Url = url, Method = "POST", Headers = headers, Body = payload}) end if S.HTTP_MODE == "http_request" then return http_request({Url = url, Method = "POST", Headers = headers, Body = payload}) end if S.HTTP_MODE == "syn" then return syn.request({Url = url, Method = "POST", Headers = headers, Body = payload}) end end) return ok and res or nil end function S.safeReadFile(name) if not S.HAS_FILE then return nil end local path = BGS_SAVE_FOLDER .. "/" .. name .. ".json" local ok, data = pcall(readfile, path) if ok and data then local ok2, decoded = pcall(HttpService.JSONDecode, HttpService, data) if ok2 then return decoded end end return nil end function S.safeWriteFile(name, data) if not S.HAS_FILE then return end pcall(function() if not isfolder(BGS_SAVE_FOLDER) then makefolder(BGS_SAVE_FOLDER) end writefile(BGS_SAVE_FOLDER .. "/" .. name .. ".json", HttpService:JSONEncode(data)) end) end S.EGG_LIST = {} S.BOX_LIST = {} function S.loadGlobal() local data = S.safeReadFile("global") or {} S.GLOBAL = { savedPositions = data.savedPositions or {}, customEggs = data.customEggs or {}, customBoxes = data.customBoxes or {}, webhookUrl = data.webhookUrl or "", lastConfigLoaded = data.lastConfigLoaded or 1, selectedTheme = data.selectedTheme or "DarkBlue", excludedPets = data.excludedPets or {}, pingOnSecret = data.pingOnSecret ~= false } for _, egg in ipairs(S.GLOBAL.customEggs) do if not table.find(S.EGG_LIST, egg) then table.insert(S.EGG_LIST, egg) end end for _, box in ipairs(S.GLOBAL.customBoxes) do if not table.find(S.BOX_LIST, box) then table.insert(S.BOX_LIST, box) end end table.sort(S.EGG_LIST) table.sort(S.BOX_LIST) end function S.saveGlobal() S.safeWriteFile("global", S.GLOBAL) end S.loadGlobal() S.PICKUPS_FOLDER = Workspace:WaitForChild("Pickups") S.NetworkRemoteEvent = ReplicatedStorage:WaitForChild("NetworkRemoteEvent") S.NetworkRemoteFunction = ReplicatedStorage:FindFirstChild("NetworkRemoteFunction") S.RADIUS, S.WALK_SPEED, S.TRAVEL_SPEED, S.REACH_DIST, S.COLLECT_ALL = 25, 16, 40, 4, false S.MODE = "LEGIT" S.farmActive, S.busy, S.isTeleporting = false, false, false S.hrp, S.humanoid, S.currentTween = nil, nil, nil S.QUEST_BOARD_POS = Vector3.new(-1725.02, 1855.20, 11034.76) S.shardQuestActive, S.shardQuestStatus, S.shardQuestTaskName, S.shardQuestPercent = false, "Idle", "None", 0 S.questEggMode = "default" S.SHARD_QUEST_TYPES = { [3000] = "Open Eggs", [5000] = "Open Eggs", [25] = "Open Legendaries", [1000000000] = "Blow Bubbles", [30000000000] = "Collect Gems", [10000000000] = "Collect Other Currency" } S.EGG_QUEST_POS = Vector3.new(-55.56, 45.67, -102.90) S.EGG_QUEST_NAME = "Spikey Egg" S.HEAVEN_POS = Vector3.new(7804.49, 100.89, -13921.14) S.GEMS_FARM_POS = Vector3.new(112.14, 40698.79, -324.98) S.VOID_CHEST_POS = Vector3.new(71.27, 32140.09, -321.91) S.GODLY_CHEST_POS = Vector3.new(93.06, 21107.09, -298.78) S.selectedEgg, S.selectedBox = nil, nil S.multiEgg, S.boxMulti = true, true S.eggOpenActive, S.boxOpenActive = false, false S.eggInterval, S.boxInterval = 0.5, 0.5 S.bubbleAutoSellActive, S.bubbleSelling, S.blowActive = false, false, false S.blowInterval = 0.1 S.SELL_ZONES = { ["Base (x1)"] = {pos = Vector3.new(-158.27, 45.35, -147.18), sellId = "Sell"}, ["Heaven (x9)"] = {pos = S.HEAVEN_POS, sellId = "HeavenSell"} } S.selectedSellZone = "Base (x1)" function S.cancelMovement() if S.currentTween then pcall(function() S.currentTween:Cancel() end) end if S.humanoid and S.hrp then pcall(function() S.humanoid:MoveTo(S.hrp.Position) end) end end function S.readLeaderstat(name) local ls = player:FindFirstChild("leaderstats") if not ls then return nil end local v = ls:FindFirstChild(name) if v then return type(v.Value) == "string" and tonumber((v.Value):gsub(",", "")) or tonumber(v.Value) end return nil end function S.bindCharacter(newChar) S.hrp = newChar:WaitForChild("HumanoidRootPart") S.humanoid = newChar:WaitForChild("Humanoid") S.humanoid.WalkSpeed = S.debugWalkSpeed or 16 S.humanoid.UseJumpPower = true S.humanoid.JumpPower = S.debugJumpPower or 50 if S.noclipActive then for _, part in ipairs(newChar:GetDescendants()) do if part:IsA("BasePart") then part.CanCollide = false end end end end if player.Character then task.spawn(S.bindCharacter, player.Character) end player.CharacterAdded:Connect(S.bindCharacter) local Rayfield = loadstring(game:HttpGet("https://sirius.menu/rayfield"))() local Window = Rayfield:CreateWindow({ Name = "BGS BY YAMAHAO V2.0", LoadingTitle = "BGS BY YAMAHAO V2.0", LoadingSubtitle = "Farm - Hatch - Bubbles - Client", ConfigurationSaving = {Enabled = true, FolderName = BGS_SAVE_FOLDER, FileName = "config"}, Discord = {Enabled = false}, KeySystem = false }) S.Window = Window local FarmTab = Window:CreateTab("Farm") local HatchTab = Window:CreateTab("Hatch") local BubbleTab = Window:CreateTab("Bubbles") local ClientTab = Window:CreateTab("Client") local CodeTab = Window:CreateTab("Codes") local SettingsTab = Window:CreateTab("Settings") pcall(function() if Rayfield.SetTheme then Rayfield:SetTheme(S.GLOBAL.selectedTheme or "DarkBlue") end end) FarmTab:CreateSection("Farming") S.farmToggleElement = FarmTab:CreateToggle({ Name = "Enable farm", CurrentValue = false, Flag = "FarmActive", Callback = function(state) S.farmActive = state if S.farmActive then S.farmConnection = RunService.Heartbeat:Connect(function() S.collectNearby() end) else if S.farmConnection then S.farmConnection:Disconnect() end end end }) FarmTab:CreateKeybind({ Name = "Toggle farm keybind", CurrentKeybind = "F", HoldToInteract = false, Flag = "FarmKeybind", Callback = function() S.farmToggleElement:Set(not S.farmActive) end }) FarmTab:CreateDropdown({ Name = "Movement mode", Options = {"LEGIT (walk)", "FAST (tween)"}, CurrentOption = {"LEGIT (walk)"}, Flag = "FarmMode", Callback = function(opt) S.MODE = opt[1] == "FAST (tween)" and "RAPIDO" or "LEGIT" end }) FarmTab:CreateSlider({ Name = "Detection radius", Range = {5, 150}, Increment = 1, Suffix = " studs", CurrentValue = 25, Flag = "FarmRadius", Callback = function(v) S.RADIUS = v end }) FarmTab:CreateSlider({ Name = "Walk speed", Range = {16, 100}, Increment = 1, CurrentValue = 16, Flag = "FarmWalkSpeed", Callback = function(v) S.WALK_SPEED = v S.debugWalkSpeed = v if S.humanoid then S.humanoid.WalkSpeed = v end end }) FarmTab:CreateSlider({ Name = "Travel speed", Range = {10, 200}, Increment = 5, Suffix = " studs/s", CurrentValue = 40, Flag = "FarmTravelSpeed", Callback = function(v) S.TRAVEL_SPEED = v end }) FarmTab:CreateSlider({ Name = "Collection distance", Range = {1, 10}, Increment = 1, Suffix = " studs", CurrentValue = 4, Flag = "FarmReachDist", Callback = function(v) S.REACH_DIST = v end }) FarmTab:CreateToggle({ Name = "Collect all in range", CurrentValue = false, Flag = "FarmCollectAll", Callback = function(v) S.COLLECT_ALL = v end }) function S.collectNearby() if S.busy or not S.hrp or S.isTeleporting then return end S.busy = true local found = {} for _, item in ipairs(S.PICKUPS_FOLDER:GetChildren()) do local part = item:IsA("BasePart") and item or item:FindFirstChildWhichIsA("BasePart") if part then local dist = (part.Position - S.hrp.Position).Magnitude if dist <= S.RADIUS then table.insert(found, {part = part, dist = dist}) end end end table.sort(found, function(a, b) return a.dist < b.dist end) if #found > 0 then local process = S.COLLECT_ALL and found or {found[1]} for _, entry in ipairs(process) do if not entry.part.Parent or S.isTeleporting or not S.farmActive then break end if S.MODE == "LEGIT" then S.humanoid:MoveTo(entry.part.Position) task.wait(0.1) else local duration = math.max(entry.dist / S.TRAVEL_SPEED, 0.05) S.currentTween = TweenService:Create( S.hrp, TweenInfo.new(duration, Enum.EasingStyle.Linear), {CFrame = CFrame.new(entry.part.Position.X, S.hrp.Position.Y, entry.part.Position.Z)} ) S.currentTween:Play() S.currentTween.Completed:Wait() end end end S.busy = false end HatchTab:CreateSection("Auto Open") HatchTab:CreateToggle({ Name = "Multi open (x3)", CurrentValue = true, Flag = "MultiOpen", Callback = function(v) S.multiEgg = v S.boxMulti = v end }) HatchTab:CreateSlider({ Name = "Interval", Range = {0.1, 5}, Increment = 0.1, Suffix = " s", CurrentValue = 0.5, Flag = "AutoOpenInterval", Callback = function(v) S.eggInterval = v S.boxInterval = v end }) HatchTab:CreateToggle({ Name = "Auto open (eggs + boxes)", CurrentValue = false, Flag = "AutoOpenBoth", Callback = function(state) S.eggOpenActive = state S.boxOpenActive = state if state then task.spawn(function() while S.eggOpenActive do if S.selectedEgg then pcall(function() S.NetworkRemoteEvent:FireServer("PurchaseEgg", S.selectedEgg, S.multiEgg) end) end task.wait(S.eggInterval) end end) end end }) if S.HAS_HOOK then task.spawn(function() task.wait(2) for _, Connection in ipairs(getconnections(S.NetworkRemoteEvent.OnClientEvent)) do local old = hookfunction(Connection.Function, function(...) local args = {...} if args[1] == "DisplayLegendaryInChat" then local user, pet, prob, isShiny, isMythic = args[2], args[3], args[4], args[5], args[6] local isExcluded = false for _, name in ipairs(S.GLOBAL.excludedPets or {}) do if name:lower() == tostring(pet):lower() then isExcluded = true break end end if not isExcluded and S.GLOBAL.webhookUrl and S.GLOBAL.webhookUrl ~= "" then local color = isShiny and 0x00D4FF or (isMythic and 0xF1C40F or 0x9B59B6) local title = (isShiny and "Shiny " or "") .. (isMythic and "Mythical" or "Legendary") .. " Hatched!" local payload = { embeds = { { title = title, color = color, fields = { {name = "Pet", value = tostring(pet), inline = true}, {name = "User", value = tostring(user), inline = true} }, timestamp = DateTime.now():ToIsoDate() } } } if prob < 0.0005 and S.GLOBAL.pingOnSecret then payload.content = "@everyone" end pcall(function() S.httpPost(S.GLOBAL.webhookUrl, payload) end) end end return old(...) end) end end) end BubbleTab:CreateSection("Auto Blow") BubbleTab:CreateSlider({ Name = "Blow interval", Range = {0.05, 2}, Increment = 0.05, Suffix = " s", CurrentValue = 0.1, Flag = "BlowInterval", Callback = function(v) S.blowInterval = v end }) BubbleTab:CreateToggle({ Name = "Auto blow", CurrentValue = false, Flag = "BlowActive", Callback = function(state) S.blowActive = state if state then task.spawn(function() while S.blowActive do pcall(function() S.NetworkRemoteEvent:FireServer("BlowBubble") end) task.wait(S.blowInterval) end end) end end }) BubbleTab:CreateSection("Auto Sell") BubbleTab:CreateToggle({ Name = "Auto sell", CurrentValue = false, Flag = "BubbleAutoSell", Callback = function(state) S.bubbleAutoSellActive = state end }) BubbleTab:CreateDropdown({ Name = "Sell zone", Options = {"Base (x1)", "Heaven (x9)"}, CurrentOption = {S.selectedSellZone}, Flag = "BubbleSellZone", Callback = function(opt) S.selectedSellZone = opt[1] end }) ClientTab:CreateSection("Performance") ClientTab:CreateToggle({ Name = "Disable map particles", CurrentValue = false, Flag = "OptParticles", Callback = function(v) for _, inst in ipairs(Workspace:GetDescendants()) do if inst:IsA("ParticleEmitter") or inst:IsA("Trail") or inst:IsA("Beam") then inst.Enabled = not v end end end }) ClientTab:CreateSection("Movement") ClientTab:CreateSlider({ Name = "Walk speed", Range = {16, 300}, Increment = 2, CurrentValue = 16, Flag = "DebugWalkSpeed", Callback = function(v) S.debugWalkSpeed = v if S.humanoid then S.humanoid.WalkSpeed = v end end }) ClientTab:CreateSlider({ Name = "Jump power", Range = {50, 300}, Increment = 5, CurrentValue = 50, Flag = "DebugJumpPower", Callback = function(v) S.debugJumpPower = v if S.humanoid then S.humanoid.UseJumpPower = true S.humanoid.JumpPower = v end end }) SettingsTab:CreateSection("Discord Webhook") SettingsTab:CreateInput({ Name = "Webhook URL", PlaceholderText = "https://discord.com/api/webhooks/...", RemoveTextAfterFocusLost = false, Flag = "WebhookUrl", Callback = function(text) S.GLOBAL.webhookUrl = text S.saveGlobal() Rayfield:Notify({Title = "Webhook", Content = "URL saved.", Duration = 3}) end }) SettingsTab:CreateToggle({ Name = "@everyone on ultra-rare pets", CurrentValue = S.GLOBAL.pingOnSecret, Flag = "PingOnSecret", Callback = function(v) S.GLOBAL.pingOnSecret = v S.saveGlobal() end }) Rayfield:LoadConfiguration() Rayfield:Notify({Title = "BGS BY YAMAHAO loaded", Content = "Successfully loaded all modules.", Duration = 6})