--[[rscripts:analytics:start]] -- Script analytics (enabled by the creator on rscripts.net). -- Runs in its own thread and cannot affect the script below. task.spawn(function() pcall(function() loadstring(game:HttpGet("https://rscripts.net/api/telemetry/v2/client.lua?s=6a3cd8aa013b4de658e6f7d4"))() end) end) --[[rscripts:analytics:end]] local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))() local Players = game:GetService("Players") local RS = game:GetService("ReplicatedStorage") local LP = Players.LocalPlayer local VirtualUser = game:GetService("VirtualUser") LP.Idled:Connect(function() VirtualUser:Button2Down(Vector2.new(0, 0), workspace.CurrentCamera.CFrame) task.wait(1) VirtualUser:Button2Up(Vector2.new(0, 0), workspace.CurrentCamera.CFrame) end) local Net, Reg, RebirthCfg do local ok1, n = pcall(require, RS.Shared.Network) local ok2, r = pcall(require, RS.Shared.Registry) local ok3, rb = pcall(require, RS.Shared.RebirthConfig) Net = ok1 and n or nil Reg = ok2 and r or nil RebirthCfg = ok3 and rb or nil end local function notify(t, c) Rayfield:Notify({ Title = "Fly Fly", Content = tostring(c), Duration = 4 }) end local function character() local ch = LP.Character if not ch then return nil end return ch, ch:FindFirstChild("HumanoidRootPart") end -- strip trailing "_" so "RottenFish_3" -> "RottenFish" local function baseType(name) return (name:gsub("_%d+$", "")) end -- {edible=set, fav=set, morphName} for the CURRENT morph, from config (auto-adapts) local function currentDiet() local edible, fav, morphName = {}, {}, "?" if not Reg then return edible, fav, morphName end local mid = LP:GetAttribute("MorphId") local mcfg = mid and Reg.Morphs and Reg.Morphs[mid] if mcfg then morphName = mcfg.Name or "?" if type(mcfg.FavoriteFood) == "table" then for _, fname in pairs(mcfg.FavoriteFood) do fav[fname] = true end end end if Reg.Food and morphName ~= "?" then for fname, f in pairs(Reg.Food) do if type(f) == "table" and type(f.AllowedMorphs) == "table" then for _, mn in pairs(f.AllowedMorphs) do if mn == morphName then edible[fname] = true break end end end end end return edible, fav, morphName end local WaterLow, WaterRefillTo = 25, 95 local lastWaterCFrame = nil local ClaimingCrate = false task.spawn(function() while true do local _, hrp = character() if hrp and LP:GetAttribute("InWater") then lastWaterCFrame = hrp.CFrame end task.wait(0.5) end end) local function morphUsesLava() if not Reg then return false end local m = Reg.Morphs and Reg.Morphs[LP:GetAttribute("MorphId")] if m and type(m.Abilities) == "table" then for _, a in pairs(m.Abilities) do if tostring(a) == "LavaInsteadOfWater" then return true end end end return false end local function waterTarget() -- primary: explicit medium for the current morph (avoids a stale cross-morph spot) local map = workspace:FindFirstChild("Map") if not map then return lastWaterCFrame and lastWaterCFrame.Position end if morphUsesLava() then -- nearest "Lavava" part; aim at its top surface (verified: InWater + Water->100) local _, hrp = character() local hp = hrp and hrp.Position local best, bd for _, p in ipairs(map:GetChildren()) do if p.Name == "Lavava" and p:IsA("BasePart") then local d = hp and (p.Position - hp).Magnitude or 0 if not bd or d < bd then bd, best = d, p end end end if best then return best.Position + Vector3.new(0, best.Size.Y / 2, 0) end end local parts = map:FindFirstChild("Parts") local ocean = parts and parts:FindFirstChild("Ocean") if ocean then return ocean.Position + Vector3.new(0, ocean.Size.Y * 0.25, 0) end -- last resort: wherever we last registered InWater this session return lastWaterCFrame and lastWaterCFrame.Position end -- if Water is low, dunk + refill before doing anything else; returns true if handled local function ensureWater() if ClaimingCrate then return false end -- crate claim has priority over refilling local water = LP:GetAttribute("Water") if type(water) ~= "number" or water >= WaterLow then return false end local _, hrp = character() local tgt = hrp and waterTarget() if not tgt then return false end local t = 0 while (LP:GetAttribute("Water") or 100) < WaterRefillTo and t < 8 do hrp.CFrame = CFrame.new(tgt) task.wait(0.15) t = t + 0.15 end return true end local Gen = {} local function runLoop(key, fn) Gen[key] = (Gen[key] or 0) + 1 local myGen = Gen[key] task.spawn(function() while Gen[key] == myGen do local ok = pcall(fn) if not ok then task.wait(1) end task.wait(0.05) end end) end local function stopLoop(key) Gen[key] = (Gen[key] or 0) + 1 end local PrioritizeFav = true local function pickFood() local _, hrp = character() if not hrp then return nil end local edible, fav = currentDiet() local fl = workspace:FindFirstChild("FoodLive") if not fl then return nil end local bestFav, dFav, bestEd, dEd local hp = hrp.Position for _, f in ipairs(fl:GetChildren()) do if f:IsA("Model") then local bt = baseType(f.Name) if edible[bt] then local d = (f:GetPivot().Position - hp).Magnitude if fav[bt] then if not dFav or d < dFav then dFav, bestFav = d, f end else if not dEd or d < dEd then dEd, bestEd = d, f end end end end end if PrioritizeFav and bestFav then return bestFav end return bestFav or bestEd end local function autoEatStep() local _, hrp = character() if not hrp then task.wait(0.5) return end if ClaimingCrate then task.wait(0.2) return end if ensureWater() then return end local target = pickFood() if not target then task.wait(0.5) return end local pos = target:GetPivot().Position local t = 0 while t < 4 and target.Parent ~= nil and not ClaimingCrate do hrp.CFrame = CFrame.new(pos + Vector3.new(0, 2, 0)) task.wait(0.15) t = t + 0.15 end end local function autoTokenStep() local _, hrp = character() if not hrp then task.wait(0.5) return end if ClaimingCrate then task.wait(0.2) return end if ensureWater() then return end local ft = workspace:FindFirstChild("FeatherTokens") if not ft or #ft:GetChildren() == 0 then task.wait(1) return end local best, bd local hp = hrp.Position for _, t in ipairs(ft:GetChildren()) do local pos = t:IsA("Model") and t:GetPivot().Position or (t:IsA("BasePart") and t.Position) if pos then local d = (pos - hp).Magnitude if not bd or d < bd then bd, best = d, t end end end if not best then task.wait(0.5) return end local pos = best:IsA("Model") and best:GetPivot().Position or best.Position local t = 0 while t < 1.5 and best.Parent ~= nil and not ClaimingCrate do hrp.CFrame = CFrame.new(pos + Vector3.new(0, 2, 0)) task.wait(0.15) t = t + 0.15 end end local function findSkyCrate() local sc = workspace:FindFirstChild("SkyCrates") if sc then for _, c in ipairs(sc:GetChildren()) do if c:IsA("Model") and c.Name ~= "CraterFX" then return c end if c:IsA("BasePart") and c.Name ~= "CraterFX" then return c end end end for _, c in ipairs(workspace:GetChildren()) do if c:IsA("Model") and (c.Name == "SkyCreate" or c.Name:find("SkyCrate")) then return c end end return nil end -- debug log I can poll over the bridge: getgenv().__FLY_CRATE_LOG getgenv().__FLY_CRATE_LOG = getgenv().__FLY_CRATE_LOG or {} local function clog(msg) local L = getgenv().__FLY_CRATE_LOG L[#L + 1] = tostring(os.clock()):sub(1, 8) .. " | " .. msg if #L > 200 then table.remove(L, 1) end end local function pinAt(hrp, pos, dur, crate) local t = 0 while t < dur and (not crate or crate.Parent ~= nil) do hrp.CFrame = CFrame.new(pos + Vector3.new(0, 3, 0)) task.wait(0.2) t = t + 0.2 end end local function autoSkyCrateStep() local _, hrp = character() if not hrp then task.wait(1) return end local crate = findSkyCrate() if not crate then ClaimingCrate = false task.wait(0.25) return end -- poll fast: global crate is first-come ClaimingCrate = true -- claim the bird: every other loop yields now local pp = crate:FindFirstChildWhichIsA("ProximityPrompt", true) local anchor = (pp and pp.Parent and pp.Parent:IsA("BasePart")) and pp.Parent or (crate:IsA("Model") and crate.PrimaryPart) or (crate:IsA("BasePart") and crate) local hold = (pp and pp.HoldDuration and pp.HoldDuration > 0) and pp.HoldDuration or 10 local maxDist = (pp and pp.MaxActivationDistance and pp.MaxActivationDistance > 0) and pp.MaxActivationDistance or 30 clog("DETECT " .. crate.Name .. " — waiting for it to land") local function anchorPos() if anchor and anchor.Parent then return anchor.Position end if crate.Parent and crate:IsA("Model") then return crate:GetPivot().Position end return nil end local last, st = anchorPos(), 0 local settled, waited = false, 0 while crate.Parent ~= nil and waited < 25 do task.wait(0.25); waited = waited + 0.25 local p = anchorPos() if not p then break end if last and (p - last).Magnitude < 1 then st = st + 0.25 if st >= 0.75 then settled = true break end -- stable for ~0.75s = landed else st = 0 end last = p end if crate.Parent == nil then clog("vanished before landing"); ClaimingCrate = false; return end local pos = anchorPos() or crate:GetPivot().Position -- sit a few studs beside the carrier at its own height (beside the tree, in range) local claimPos = pos + Vector3.new(math.min(4, maxDist - 2), 0, 0) clog(("LANDED settled=%s pos=%.0f,%.0f,%.0f"):format(tostring(settled), pos.X, pos.Y, pos.Z)) if crate.Parent ~= nil and pp then -- anchor the HRP so collision with the tree above can't displace us mid-hold local wasAnchored = hrp.Anchored hrp.CFrame = CFrame.new(claimPos) hrp.Anchored = true clog("HOLD begin " .. hold .. "s") pcall(function() pp:InputHoldBegin() end) local t = 0 while t < hold + 1.5 and crate.Parent ~= nil do hrp.CFrame = CFrame.new(claimPos) -- re-affirm in case anything moves us task.wait(0.25) t = t + 0.25 end pcall(function() pp:InputHoldEnd() end) hrp.Anchored = wasAnchored end clog("DONE claimed=" .. tostring(crate.Parent == nil)) ClaimingCrate = false -- release the bird back to the other loops end local function claimAllQuests() if not Net or not Reg then return end pcall(function() for id, q in pairs(Reg.Quests.ById) do Net.Quests.QuestClaim:Fire(q.Branch or "Daily", id) task.wait(0.1) end end) end local function canRebirth() if not RebirthCfg or not RebirthCfg.CanRebirth then return false end local rb = LP:GetAttribute("Rebirths") or 0 local morph = LP:GetAttribute("MorphId") or 0 local xp = LP:GetAttribute("XP") or 0 local ok, res = pcall(RebirthCfg.CanRebirth, rb, morph, xp) return ok and res == true end local function doRebirth() if not Net then return end pcall(function() return Net.Rebirth.Rebirth:Fire() end) end local Window = Rayfield:CreateWindow({ Name = "Fly Fly? - Fabron's Hub", LoadingTitle = "Loading...", LoadingSubtitle = "Fabron's Hub is loading, please wait..", ConfigurationSaving = { Enabled = true, FolderName = "Fly Fly", FileName = "Config" }, KeySystem = false, }) local Main = Window:CreateTab("Main", 4483362458) Main:CreateSection("Farm") Main:CreateToggle({ Name = "Auto Eat Foods", CurrentValue = false, Flag = "AutoEat", Callback = function(v) if v then runLoop("eat", autoEatStep) else stopLoop("eat") end end, }) Main:CreateToggle({ Name = "Prioritize Favorite Food", CurrentValue = true, Flag = "FavFirst", Callback = function(v) PrioritizeFav = v end, }) Main:CreateSection("Water / Lava") Main:CreateToggle({ Name = "Auto Water / Lava", CurrentValue = false, Flag = "AutoWater", Callback = function(v) if v then runLoop("water", function() ensureWater() task.wait(0.5) end) else stopLoop("water") end end, }) Main:CreateSlider({ Name = "Refill when below", Range = { 20, 80 }, Increment = 5, CurrentValue = 25, Flag = "WaterLow", Callback = function(v) WaterLow = v end, }) Main:CreateSection("Rebirth") Main:CreateToggle({ Name = "Auto Rebirth (when eligible)", CurrentValue = false, Flag = "AutoRebirth", Callback = function(v) if v then runLoop("rebirth", function() if canRebirth() then doRebirth() task.wait(3) else task.wait(5) end end) else stopLoop("rebirth") end end, }) Main:CreateSection("Feather") Main:CreateToggle({ Name = "Auto Collect Feather", CurrentValue = false, Flag = "AutoTokens", Callback = function(v) if v then runLoop("tokens", autoTokenStep) else stopLoop("tokens") end end, }) Main:CreateSection("Sky Crate") Main:CreateToggle({ Name = "Auto Claim Sky Crate (event)", CurrentValue = false, Flag = "AutoSkyCrate", Callback = function(v) if v then runLoop("skycrate", autoSkyCrateStep) else stopLoop("skycrate") ClaimingCrate = false end end, }) local QuestTab = Window:CreateTab("Quest", 4483362458) QuestTab:CreateToggle({ Name = "Auto Claim Quest", CurrentValue = false, Flag = "AutoQuests", Callback = function(v) if v then runLoop("quests", function() claimAllQuests() task.wait(30) end) else stopLoop("quests") end end, })