--[[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=6a2131d3266cdb4c429ef465"))() 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") do local function antiAfkNudge() pcall(function() VirtualUser:CaptureController() VirtualUser:ClickButton2(Vector2.new(), workspace.CurrentCamera.CFrame) end) end LP.Idled:Connect(antiAfkNudge) task.spawn(function() while task.wait(60) do antiAfkNudge() end end) end local Window = Rayfield:CreateWindow({ Name = "Shepherd Simulator - Fabron's Hub", LoadingTitle = "Loading...", LoadingSubtitle = "Fabron's Hub is loading, please wait..", ConfigurationSaving = { Enabled = true, FolderName = "Shepherd Simulator", FileName = "Config" }, KeySystem = false, }) -- Remote refs local Events = RS:WaitForChild("Events") local E_Quest = Events:WaitForChild("E_Quest") -- (slot,"Progress",amount) -- client-trusted progress local E_RewardQuest= Events:WaitForChild("E_RewardQuest") -- (questDef) -- pays a COMPLETE quest local SheepAction = Events:WaitForChild("SheepAction") -- "out"/"sheepfold"/"grazing"/"stopgrazing" local E_Capture = Events:WaitForChild("E_Capture") -- capture minigame: ("Jump"/"StartStruggle"/"EndStruggle"/"Caught", cube) local E_SheepMarket= Events:WaitForChild("E_SheepMarket") -- (cube,"sell") -- sell an OWNED sheep for money local totalGained = 0 -- coins farmed this session (shared across tabs) local QUEST_BY_ID = { quest_001 = { Name = "Buy a sheep !", Description = "Buy a sheep", MaxProgress = 1, RequiredLevel = 0, Coins = 5 }, quest_002 = { Name = "Shear a sheep !", Description = "Shear a sheep", MaxProgress = 1, RequiredLevel = 0, Coins = 5 }, quest_003 = { Name = "Sell your wool !", Description = "Sell wool", MaxProgress = 1, RequiredLevel = 0, Coins = 5 }, quest_004 = { Name = "Put your sheep out to pasture !", Description = "Pasture", MaxProgress = 1, RequiredLevel = 0, Coins = 10 }, quest_005 = { Name = "Buy 2 sheep !", Description = "Buy a sheep", MaxProgress = 2, RequiredLevel = 0, Coins = 15 }, quest_006 = { Name = "Upgrade your sheepfold !", Description = "Upgrade sheepfold", MaxProgress = 1, RequiredLevel = 0, Coins = 25 }, quest_007 = { Name = "Unlock the rich pasture !", Description = "Unlock a pasture", MaxProgress = 1, RequiredLevel = 0, Coins = 20 }, quest_008 = { Name = "Buy a dog !", Description = "Buy a dog", MaxProgress = 1, RequiredLevel = 0, Coins = 10 }, quest_009 = { Name = "Shear 5 sheep !", Description = "Shear a sheep", MaxProgress = 5, RequiredLevel = 0, Coins = 20 }, quest_010 = { Name = "Pet a sheep !", Description = "Pet a sheep", MaxProgress = 1, RequiredLevel = 0, Coins = 5 }, quest_0011 = { Name = "Shear 10 sheep !", Description = "Shear a sheep", MaxProgress = 10, RequiredLevel = 0, Coins = 35 }, quest_012 = { Name = "Buy 5 sheep !", Description = "Buy a sheep", MaxProgress = 5, RequiredLevel = 0, Coins = 40 }, quest_013 = { Name = "Catch a wild sheep !", Description = "Catch a sheep", MaxProgress = 1, RequiredLevel = 0, Coins = 20 }, quest_014 = { Name = "Catch 2 wild sheep !", Description = "Catch a sheep", MaxProgress = 2, RequiredLevel = 1, Coins = 40 }, quest_015 = { Name = "Catch 5 wild sheep !", Description = "Catch a sheep", MaxProgress = 5, RequiredLevel = 2, Coins = 100 }, } local FORCE_AMOUNT = 999 -- server clamps this down to the quest's MaxProgress local SLOTS = { "Quest1", "Quest2", "Quest3" } for _, q in pairs(QUEST_BY_ID) do q.def = { Description = q.Description, MaxProgress = q.MaxProgress, Name = q.Name, RequiredLevel = q.RequiredLevel, Reward = { Coins = q.Coins }, } end local RF_PlayerData do local rf = RS:WaitForChild("RF", 10) RF_PlayerData = rf and rf:WaitForChild("RF_GetPlayerData", 10) end -- The Sheepfold folder you OWN (Owner attribute == your UserId), not the nearest. local function findOwnedFold() local folds = workspace:FindFirstChild("Sheepfolds") if not folds then return nil end for _, f in ipairs(folds:GetChildren()) do if f:GetAttribute("Owner") == LP.UserId then return f end end return nil end -- The wool-crate touch pad inside YOUR fold: Building..Crate.Button.Platform local function findWoolCratePlatform() local fold = findOwnedFold() if not fold then return nil end for _, d in ipairs(fold:GetDescendants()) do if d:IsA("BasePart") and d.Name == "Platform" and d.Parent and d.Parent.Name == "Button" and d.Parent.Parent and d.Parent.Parent.Name == "Crate" then return d end end return nil end -- TAB 1 โ€” AUTO FARM local FarmTab = Window:CreateTab("Auto Farm", 4483362458) local moneyLabel = FarmTab:CreateLabel("Money: " .. tostring(LP.Money.Value)) local statusLabel = FarmTab:CreateLabel("Gained this session: 0") FarmTab:CreateSection("Coins") local function playerLevel() local lv = LP:FindFirstChild("Level") if lv and lv:IsA("ValueBase") then return tonumber(lv.Value) or 0 end return tonumber(LP:GetAttribute("Level")) or 0 end local function bestFarmId() local lvl, bestId, bestCoins = playerLevel(), "quest_001", -1 for id, q in pairs(QUEST_BY_ID) do if lvl >= q.RequiredLevel and q.Coins > bestCoins then bestId, bestCoins = id, q.Coins end end return bestId end local autoCoins = false local coinsBurst = 8 -- chains fired per slot per frame; 8 = measured peak local coinsGen = 0 -- generation token so a fast re-toggle can't stack loops local function claimSlot(slot, q) E_Quest:FireServer(slot, "Progress", FORCE_AMOUNT) E_RewardQuest:FireServer(q.def) end local function resyncSlots(bestId) if not RF_PlayerData then return end local ok, data = pcall(function() return RF_PlayerData:InvokeServer() end) local quests = ok and type(data) == "table" and data.Quests if not quests then return end for _, slot in ipairs(SLOTS) do local id = quests[slot] local q = id and id ~= "" and QUEST_BY_ID[id] if q and id ~= bestId then claimSlot(slot, q) end end end FarmTab:CreateSlider({ Name = "Chains per frame - 8 = max coins, lower = smoother FPS", Range = { 1, 8 }, Increment = 1, CurrentValue = 8, Flag = "CoinsPerFrame", Callback = function(v) coinsBurst = math.clamp(math.floor(tonumber(v) or 8), 1, 8) end, }) FarmTab:CreateToggle({ Name = "Auto Farm Coins", CurrentValue = false, Flag = "AutoFarmCoins", Callback = function(state) autoCoins = state coinsGen = coinsGen + 1 local myGen = coinsGen if not autoCoins then return end task.spawn(function() local prevMoney = LP.Money.Value local lastResync = 0 local resyncing = false local id = bestFarmId() local q = QUEST_BY_ID[id] while autoCoins and myGen == coinsGen do for _ = 1, coinsBurst do for _, slot in ipairs(SLOTS) do E_Quest:FireServer(slot, "NewQuest", id) -- takes only on an EMPTY slot claimSlot(slot, q) end end if not resyncing and os.clock() - lastResync > 2 then lastResync, resyncing = os.clock(), true task.spawn(function() id = bestFarmId() q = QUEST_BY_ID[id] resyncSlots(id) resyncing = false end) end local now = LP.Money.Value if now > prevMoney then totalGained = totalGained + (now - prevMoney) end prevMoney = now task.wait() end end) end, }) FarmTab:CreateSection("Sheepfold") local autoWool = false FarmTab:CreateToggle({ Name = "Auto Collect Money from Your Sheepfold", CurrentValue = false, Flag = "AutoWool", Callback = function(state) autoWool = state if not autoWool then return end task.spawn(function() while autoWool do local plat = findWoolCratePlatform() local hrp = LP.Character and LP.Character:FindFirstChild("HumanoidRootPart") if plat and hrp and typeof(firetouchinterest) == "function" then firetouchinterest(hrp, plat, 0) task.wait(0.1) firetouchinterest(hrp, plat, 1) end task.wait(0.5) end end) end, }) FarmTab:CreateSection("Wild Sheep") FarmTab:CreateParagraph({ Title = "Auto Catch & Sell", Content = "Catches wild sheep and immediately sells each catch ", }) local CAP_JUMPS = 3 -- "Jump" pumps before the struggle local autoWild = false local wildGen = 0 -- generation token so a fast re-toggle can't stack loops local function firstWildCube() local CS = workspace:FindFirstChild("CubeSheep") if not CS then return nil end for _, c in ipairs(CS:GetChildren()) do if c:IsA("BasePart") and c.Name == "Cube" and c:GetAttribute("Owner") == "Wild" then return c end end return nil end local function captureCube(cube, alive) E_Capture:FireServer("Caught", cube); task.wait(0.4) if cube:GetAttribute("Owner") == LP.UserId then return true end for _ = 1, CAP_JUMPS do if not alive() then return false end E_Capture:FireServer("Jump", cube); task.wait(0.3) end E_Capture:FireServer("StartStruggle", cube); task.wait(0.5) E_Capture:FireServer("EndStruggle", cube); task.wait(0.35) E_Capture:FireServer("Caught", cube); task.wait(0.6) return cube:GetAttribute("Owner") == LP.UserId end FarmTab:CreateToggle({ Name = "Auto Catch & Sell Wild Sheep", CurrentValue = false, Flag = "AutoWildCatchSell", Callback = function(state) autoWild = state wildGen = wildGen + 1 local myGen = wildGen if not autoWild then return end task.spawn(function() while autoWild and myGen == wildGen do local cube = firstWildCube() if cube then local before = LP.Money.Value if captureCube(cube, function() return autoWild end) then -- sell ONLY this catch (fold sheep are never passed here) E_SheepMarket:FireServer(cube, "sell") task.wait(0.5) local g = LP.Money.Value - before if g > 0 then totalGained = totalGained + g end end task.wait(0.2) else task.wait(1.5) -- no wild sheep loaded โ€” wait for respawns end end end) end, }) -- TAB 2 โ€” SHEEPS local SHEEP_PRICE = { WhiteSheep = 15, BlackSheep = 30, BrownSheep = 40, BlackHeadSheep = 70, SolognotSheep = 120, ScottishSheep = 150, JacobSheep = 290, ArapawaSheep = 240, IslandSheep = 250, LoaghtanSheep = 300, IcelandicSheep = 500, RackaSheep = 320, ShadowSheep = 400, GiantSheep = 650, PinkSheep = 190, VolcanicSheep = 300, LightningSheep = 3000, GoldSheep = 10000, SolarSheep = 2000, AlienSheep = 2200, PhoenixSheep = 10000, AncestralSheep = 3000000, GiantGoldSheep = 6000, ErosSheep = 5000, EclipseSheep = 3000, DiabloSheep = 2000, AngelicSheep = 4000, SpeedSheep = 320, GlacierSheep = 1000, UnicornSheep = 3000, IceSheep = 20000, StormSheep = 6000000, } local SHEEP_ORDER = { "WhiteSheep","BlackSheep","BrownSheep","BlackHeadSheep","SolognotSheep","ScottishSheep", "PinkSheep","ArapawaSheep","IslandSheep","JacobSheep","VolcanicSheep","LoaghtanSheep", "SpeedSheep","RackaSheep","ShadowSheep","IcelandicSheep","GiantSheep","GlacierSheep", "SolarSheep","DiabloSheep","AlienSheep","UnicornSheep","LightningSheep","EclipseSheep", "AngelicSheep","ErosSheep","GiantGoldSheep","GoldSheep","IceSheep","PhoenixSheep", "AncestralSheep","StormSheep", } local function spaceless(s) return (tostring(s):gsub("%s", ""):lower()) end local KEY_BY_SPACELESS = {} for _, key in ipairs(SHEEP_ORDER) do KEY_BY_SPACELESS[spaceless(key)] = key end local LABEL_TO_KEY = {} local dropdownOptions = {} for _, key in ipairs(SHEEP_ORDER) do local display = key:gsub("(%l)(%u)", "%1 %2") local label = string.format("%s ($%d)", display, SHEEP_PRICE[key] or 0) LABEL_TO_KEY[label] = key dropdownOptions[#dropdownOptions + 1] = label end local SheepTab = Window:CreateTab("Sheeps", 4483362458) local selectedSheepKeys = {} local autoBuy = false local buyDelay = 0.5 local affordGuard = true local buyGen = 0 SheepTab:CreateSection("Auto Buy") SheepTab:CreateParagraph({ Title = "Auto buy sheep", Content = "Auto TP to Sheep and Buy loop", }) SheepTab:CreateDropdown({ Name = "Sheep to auto-buy", Options = dropdownOptions, CurrentOption = {}, MultipleOptions = true, Flag = "BuySheepSelect", Callback = function(opts) selectedSheepKeys = {} for _, label in ipairs(opts) do local key = LABEL_TO_KEY[label] if key then selectedSheepKeys[key] = true end end end, }) SheepTab:CreateSlider({ Name = "Buy delay (s)", Range = { 0.2, 3 }, Increment = 0.1, CurrentValue = 0.5, Flag = "BuyDelay", Callback = function(v) buyDelay = v end, }) SheepTab:CreateToggle({ Name = "Stop a type when you can't afford it", CurrentValue = true, Flag = "AffordGuard", Callback = function(v) affordGuard = v end, }) local charLock = { owner = nil, beat = 0 } local CHAR_LOCK_STALE = 10 -- seconds without a beat before the holder is presumed dead -- Called by the holder to say "still using the character". Cheap; call it often. local function charLockBeat(tag) if charLock.owner == tag then charLock.beat = os.clock() end end -- Take the lock if free, already ours, or abandoned by a dead holder. local function charLockTake(tag) if charLock.owner == tag then charLock.beat = os.clock(); return true end if charLock.owner == nil or os.clock() - charLock.beat > CHAR_LOCK_STALE then charLock.owner, charLock.beat = tag, os.clock() return true end return false end local function charLockFree(tag) if charLock.owner == tag then charLock.owner = nil end end local function charLockWait(tag, timeout, alive) local t0 = os.clock() while os.clock() - t0 < (timeout or 15) do if alive and not alive() then return false end if charLockTake(tag) then return true end task.wait(0.2) end return false end local function foldLivestock() local fold = findOwnedFold() local sign = fold and fold:FindFirstChild("Sign") -- Recursive: the label sits inside the sign's SurfaceGui, not directly under it. local lbl = sign and sign:FindFirstChild("Livestock", true) if not (lbl and lbl:IsA("TextLabel")) then return nil end local cur, max = tostring(lbl.Text):match("(%d+)%s*/%s*(%d+)") cur, max = tonumber(cur), tonumber(max) if not (cur and max) then return nil end return cur, max end local function buyOnePass(myGen) local function alive() return autoBuy and myGen == buyGen end local hrp = LP.Character and LP.Character:FindFirstChild("HumanoidRootPart") local CS = workspace:FindFirstChild("CubeSheep") if not (hrp and CS) then return end for _, cube in ipairs(CS:GetChildren()) do if not alive() then return end if cube:IsA("BasePart") and cube.Name == "Cube" then local prompt = cube:FindFirstChildOfClass("ProximityPrompt") if prompt then local key = KEY_BY_SPACELESS[spaceless(prompt.ObjectText)] if key and selectedSheepKeys[key] and not (affordGuard and LP.Money.Value < (SHEEP_PRICE[key] or 0)) then if charLockWait("buy", 1.5, alive) then if cube.Parent and prompt.Parent == cube then local restore = hrp.CFrame hrp.CFrame = cube.CFrame + Vector3.new(0, 3, 0) task.wait(0.15) if (cube.Position - hrp.Position).Magnitude <= prompt.MaxActivationDistance and typeof(fireproximityprompt) == "function" then fireproximityprompt(prompt) end task.wait(0.1) hrp.CFrame = restore end charLockFree("buy") task.wait(buyDelay) end end end end end end SheepTab:CreateToggle({ Name = "Auto Buy Selected Sheep", CurrentValue = false, Flag = "AutoBuy", Callback = function(state) autoBuy = state buyGen = buyGen + 1 local myGen = buyGen if not autoBuy then return end task.spawn(function() while autoBuy and myGen == buyGen do local cur, max = foldLivestock() if cur and max and cur >= max then Rayfield:Notify({ Title = "Auto Buy", Content = "Sheepfold is full (" .. cur .. "/" .. max .. ") โ€” stopping.", Duration = 5 }) autoBuy = false break end if next(selectedSheepKeys) ~= nil then buyOnePass(myGen) else task.wait(0.5) end task.wait(0.2) end -- Never leave the character locked behind a loop that has stopped. charLockFree("buy") end) end, }) SheepTab:CreateSection("Herding") SheepTab:CreateButton({ Name = "Bring sheep out", Callback = function() SheepAction:FireServer("out") end }) SheepTab:CreateButton({ Name = "Bring sheep in", Callback = function() SheepAction:FireServer("sheepfold") end }) SheepTab:CreateButton({ Name = "Start grazing", Callback = function() SheepAction:FireServer("grazing") end }) SheepTab:CreateButton({ Name = "Stop grazing", Callback = function() SheepAction:FireServer("stopgrazing") end }) local PASTURE_ORDER = { "Pasture_1","Pasture_2","Pasture_3","Pasture_4","Pasture_5","Pasture_6","Pasture_7","Pasture_8" } local PASTURE_PRICE = { Pasture_1=0, Pasture_2=50, Pasture_3=500, Pasture_4=3200, Pasture_5=10000, Pasture_6=25000, Pasture_7=0, Pasture_8=0 } local function getUnlockedPastures() local set = { Pasture_1 = true } -- free starter is always owned local folder = workspace:FindFirstChild("Pastures") if folder then for _, name in ipairs(PASTURE_ORDER) do local part = folder:FindFirstChild(name) if part and part:GetAttribute("Unlocked") == true then set[name] = true end end end if RF_PlayerData then local ok, data = pcall(function() return RF_PlayerData:InvokeServer() end) if ok and type(data) == "table" and type(data.Pastures) == "table" then for _, name in pairs(data.Pastures) do set[name] = true end end end return set end local function bestOwnedPasture(unlocked) for i = #PASTURE_ORDER, 1, -1 do if unlocked[PASTURE_ORDER[i]] then return PASTURE_ORDER[i] end end return "Pasture_1" end local function pastureTeleportCFrame(name) local folder = workspace:FindFirstChild("Pastures") local part = folder and folder:FindFirstChild(name) if not part then return nil end local center = part.Position local params = RaycastParams.new() params.FilterType = Enum.RaycastFilterType.Exclude params.FilterDescendantsInstances = { LP.Character, folder } local origin = center + Vector3.new(0, part.Size.Y, 0) local hit = workspace:Raycast(origin, Vector3.new(0, -(part.Size.Y * 2 + 400), 0), params) local groundY = hit and hit.Position.Y or center.Y return CFrame.new(center.X, groundY + 4, center.Z) end -- Build the dropdown showing ALL pastures, locked ones flagged (state at load). local unlockedAtLoad = getUnlockedPastures() local pastureLabelToName = {} local pastureOptions = {} for _, name in ipairs(PASTURE_ORDER) do local num = name:match("%d+") local locked = not unlockedAtLoad[name] local price = PASTURE_PRICE[name] local label = string.format("Pasture %s %s%s", num, locked and "๐Ÿ”’ " or "", price == 0 and "(free)" or ("($" .. price .. ")")) pastureLabelToName[label] = name pastureOptions[#pastureOptions + 1] = label end local function flockWoolStats() local CS = workspace:FindFirstChild("CubeSheep") if not CS then return 0, 0, 0 end local n, full, sum = 0, 0, 0 for _, c in ipairs(CS:GetChildren()) do if c:GetAttribute("Owner") == LP.UserId and c:GetAttribute("SheepName") then n = n + 1 local w = c:GetAttribute("Wool") or 0 sum = sum + w if w >= 99.5 then full = full + 1 end end end return full, n, (n > 0 and sum / n or 0) end local function flockLocation() local CS = workspace:FindFirstChild("CubeSheep") if not CS then return 0, 0, 0 end local n, fold, pasture = 0, 0, 0 for _, c in ipairs(CS:GetChildren()) do if c:GetAttribute("Owner") == LP.UserId and c:GetAttribute("SheepName") then n = n + 1 if c:GetAttribute("Sheepfold") == true then fold = fold + 1 end if c:GetAttribute("Pasture") == true then pasture = pasture + 1 end end end return fold, pasture, n end local autoGraze = false local selectedPasture = "Pasture_1" local useBestPasture = false local grazeSafety = 45 -- hard cap (s) per phase so the loop can never hang local grazeGen = 0 -- generation token so a fast re-toggle can't stack loops local grazeStatus = nil local function setGrazeStatus(text) if grazeStatus then grazeStatus:Set("Auto Graze: " .. text) end end local CatchTab = Window:CreateTab("Catch", 4483362458) local selectedCatchKeys = {} local autoCatch = false local catchDelay = 0.2 local catchGen = 0 -- generation token so a fast re-toggle can't stack loops -- Plain (price-less) type options for the catch selector. local catchLabelToKey = {} local catchOptions = {} for _, key in ipairs(SHEEP_ORDER) do local display = key:gsub("(%l)(%u)", "%1 %2") catchLabelToKey[display] = key catchOptions[#catchOptions + 1] = display end -- First loaded WILD cube whose SheepName matches one of the selected types. local function firstSelectedWildCube(sel) local CS = workspace:FindFirstChild("CubeSheep") if not CS then return nil end for _, c in ipairs(CS:GetChildren()) do if c:IsA("BasePart") and c.Name == "Cube" and c:GetAttribute("Owner") == "Wild" then local key = KEY_BY_SPACELESS[spaceless(c:GetAttribute("SheepName") or "")] if key and sel[key] then return c end end end return nil end CatchTab:CreateSection("Auto Catch") CatchTab:CreateParagraph({ Title = "Auto Catch Wild Sheep", Content = "Catches ONLY the wild sheep types you pick and keeps them (no selling).", }) CatchTab:CreateDropdown({ Name = "Wild sheep to catch", Options = catchOptions, CurrentOption = {}, MultipleOptions = true, Flag = "CatchSheepSelect", Callback = function(opts) selectedCatchKeys = {} for _, label in ipairs(opts) do local key = catchLabelToKey[label] if key then selectedCatchKeys[key] = true end end end, }) CatchTab:CreateSlider({ Name = "Catch delay (s)", Range = { 0.1, 3 }, Increment = 0.1, CurrentValue = 0.2, Flag = "CatchDelay", Callback = function(v) catchDelay = v end, }) CatchTab:CreateToggle({ Name = "Auto Catch Selected Wild Sheep", CurrentValue = false, Flag = "AutoCatch", Callback = function(state) autoCatch = state catchGen = catchGen + 1 local myGen = catchGen if not autoCatch then return end task.spawn(function() while autoCatch and myGen == catchGen do if next(selectedCatchKeys) == nil then task.wait(0.5) -- nothing selected yet else local cube = firstSelectedWildCube(selectedCatchKeys) if cube then captureCube(cube, function() return autoCatch end) -- catch only, keep it task.wait(catchDelay) else task.wait(1.5) -- none loaded โ€” wait for respawns end end end end) end, }) local EventsTab = Window:CreateTab("Events", 4483362458) local EVENT_ATTRS = { Storm = "โšก Storm", Eruption = "๐ŸŒ‹ Eruption", Wolf = "๐Ÿบ Wolf", UFO = "๐Ÿ›ธ UFO" } local EVENT_LABEL_BY_PASTURE = { Pasture_8 = { Storm = "โ„๏ธ Snowstorm" } } local function currentPasture() local hrp = LP.Character and LP.Character:FindFirstChild("HumanoidRootPart") if not hrp then return nil end local folder = workspace:FindFirstChild("Pastures") if not folder then return nil end local pos = hrp.Position for _, part in ipairs(folder:GetChildren()) do if part:IsA("BasePart") then local lp = part.CFrame:PointToObjectSpace(pos) local s = part.Size / 2 if math.abs(lp.X) <= s.X and math.abs(lp.Z) <= s.Z then return part.Name, part end end end return nil end -- Label of the active event on a pasture part, or nil if none is active. local function activeEventOf(part) if not part then return nil end local overrides = EVENT_LABEL_BY_PASTURE[part.Name] for attr, label in pairs(EVENT_ATTRS) do if part:GetAttribute(attr) == true then return (overrides and overrides[attr]) or label end end if part:GetAttribute("Event") == true then return "โš  Event" end return nil end EventsTab:CreateSection("Player Position") local posLabel = EventsTab:CreateLabel("Position: detecting...") local eventLabel = EventsTab:CreateLabel("Event here: none") EventsTab:CreateSection("Auto Protect") EventsTab:CreateParagraph({ Title = "Auto Bring In Sheep on Event", Content = "When a Storm / Eruption / Wolf / UFO starts in the pasture you are " .. "standing in, your flock is brought back to the sheepfold automatically -- " .. "then sent back out to graze once the event clears.", }) local autoProtect = false EventsTab:CreateToggle({ Name = "Auto Bring In Sheep on Event", CurrentValue = false, Flag = "AutoProtectEvent", Callback = function(v) autoProtect = v end, }) task.spawn(function() local broughtIn = false while task.wait(0.4) do local name, part = currentPasture() posLabel:Set("Position: " .. (name and name:gsub("_", " ") or "Not in a pasture")) local ev = name and activeEventOf(part) or nil eventLabel:Set("Event here: " .. (ev or "none")) if not autoProtect then broughtIn = false elseif name and ev then if not broughtIn then -- must stop grazing before the fold will accept them SheepAction:FireServer("stopgrazing"); task.wait(0.3) SheepAction:FireServer("sheepfold") broughtIn = true Rayfield:Notify({ Title = "Auto Protect", Content = ev .. " in " .. name:gsub("_", " ") .. " โ€” bringing sheep in.", Duration = 4 }) end elseif broughtIn then if name then SheepAction:FireServer("out"); task.wait(0.3) SheepAction:FireServer("grazing") Rayfield:Notify({ Title = "Auto Protect", Content = "Event cleared in " .. name:gsub("_", " ") .. " โ€” sending sheep back out.", Duration = 4 }) end broughtIn = false end end end) local GRAZE_STALL = 6 -- seconds avg wool may stay flat before we move on local HARVEST_FLOOR = 5 -- avg wool <= this in the fold == harvested / drained -- Active-event label on the named pasture (reuses the Events-tab helper), or nil. local function pastureEvent(name) local folder = workspace:FindFirstChild("Pastures") local part = folder and folder:FindFirstChild(name) return part and activeEventOf(part) or nil end -- TP onto the ground inside the named pasture. Returns true on success. local function tpToPasture(name) local cf = pastureTeleportCFrame(name) local hrp = LP.Character and LP.Character:FindFirstChild("HumanoidRootPart") if hrp and cf then hrp.CFrame = cf; return true end return false end local function bringFlockInConfirmed(timeout) SheepAction:FireServer("stopgrazing"); task.wait(0.3) SheepAction:FireServer("sheepfold") local t0 = os.clock() while os.clock() - t0 < (timeout or 4) do local fold, pasture, n = flockLocation() if n == 0 or pasture == 0 then return true end SheepAction:FireServer("sheepfold") -- re-nudge stragglers still out task.wait(0.4) end return false end local function sheepFullPrompt() local pg = LP:FindFirstChild("PlayerGui") local sg = pg and pg:FindFirstChild("ScreenGui") local m = sg and sg:FindFirstChild("Message") if not m or not m.Visible then return false end local cg = m:FindFirstChild("CanvasGroup") local tl = cg and cg:FindFirstChild("TextLabel") local t = (tl and tl.Text or ""):lower() return t:find("full") ~= nil and t:find("sheepfold") ~= nil end local function runGrazeLoop(myGen) local function alive() return autoGraze and myGen == grazeGen end local startHrp = LP.Character and LP.Character:FindFirstChild("HumanoidRootPart") local home = startHrp and startHrp.CFrame -- restored when the loop ends while alive() do local unlocked = getUnlockedPastures() local target = useBestPasture and bestOwnedPasture(unlocked) or selectedPasture if not unlocked[target] then setGrazeStatus(target:gsub("_", " ") .. " locked โ€” pick an owned pasture") Rayfield:Notify({ Title = "Auto Graze", Content = target:gsub("_", " ") .. " is locked โ€” pick an owned pasture.", Duration = 4 }) task.wait(2) elseif not charLockWait("graze", 15, alive) then setGrazeStatus("waiting for Auto Buy to finish its hopโ€ฆ") task.wait(0.5) else bringFlockInConfirmed(3) charLockBeat("graze") if not tpToPasture(target) then charLockFree("graze") task.wait(1) else -- GRAZE PHASE: send the flock out and graze until wool is full. task.wait(1) SheepAction:FireServer("out"); task.wait(1) SheepAction:FireServer("grazing") local phaseStart, stallStart, lastAvg, sheltered = os.clock(), os.clock(), -1, false while alive() do task.wait(0.4) charLockBeat("graze") local ev = pastureEvent(target) if ev then -- event in this pasture: shelter the flock, pause the timers if not sheltered then SheepAction:FireServer("stopgrazing"); task.wait(0.3) SheepAction:FireServer("sheepfold") sheltered = true Rayfield:Notify({ Title = "Auto Graze", Content = ev .. " in " .. target:gsub("_", " ") .. " โ€” sheltering flock.", Duration = 4 }) end setGrazeStatus("sheltering โ€” " .. ev .. " in " .. target:gsub("_", " ")) phaseStart, stallStart, lastAvg = os.clock(), os.clock(), -1 else if sheltered then -- event cleared: return to the pasture and resume grazing tpToPasture(target); task.wait(0.5) SheepAction:FireServer("out"); task.wait(0.5) SheepAction:FireServer("grazing") sheltered = false phaseStart, stallStart, lastAvg = os.clock(), os.clock(), -1 Rayfield:Notify({ Title = "Auto Graze", Content = "Event cleared โ€” resuming graze.", Duration = 4 }) end local full, n, avg = flockWoolStats() setGrazeStatus("grazing " .. target:gsub("_", " ") .. " โ€” avg wool " .. math.floor(avg + 0.5) .. "% (" .. full .. "/" .. n .. " full)") if sheepFullPrompt() then break end -- game says full if n > 0 and full >= n then break end -- all wool full if math.abs(avg - lastAvg) < 0.5 then if os.clock() - stallStart >= GRAZE_STALL then break end -- wool stopped rising else stallStart, lastAvg = os.clock(), avg -- wool still climbing end if os.clock() - phaseStart >= grazeSafety then break end -- hard cap end end if not alive() then break end setGrazeStatus("harvesting " .. target:gsub("_", " ") .. "โ€ฆ") bringFlockInConfirmed(4) charLockFree("graze") local hStart, minAvg = os.clock(), 1e9 while alive() do task.wait(0.6) local _, n, avg = flockWoolStats() setGrazeStatus("harvesting " .. target:gsub("_", " ") .. " โ€” avg wool " .. math.floor(avg + 0.5) .. "%") if avg < minAvg then minAvg = avg end local elapsed = os.clock() - hStart if n == 0 then break end -- no sheep if avg <= HARVEST_FLOOR then break end -- fully drained -- banked = dropped then turned back up, after a short settle time if elapsed >= 3 and avg >= minAvg + 10 then break end -- batch banked if elapsed >= 12 then break end -- hard cap end end end end charLockWait("graze", 10) bringFlockInConfirmed(4) local hrp = LP.Character and LP.Character:FindFirstChild("HumanoidRootPart") if hrp and home then hrp.CFrame = home end charLockFree("graze") if myGen == grazeGen then setGrazeStatus("idle") end end SheepTab:CreateSection("Auto Graze") -- Live status readout, updated each poll by runGrazeLoop (forward-declared above). grazeStatus = SheepTab:CreateLabel("Auto Graze: idle") SheepTab:CreateDropdown({ Name = "Pasture", Options = pastureOptions, CurrentOption = { pastureOptions[1] }, MultipleOptions = false, Flag = "GrazePasture", Callback = function(opt) local label = type(opt) == "table" and opt[1] or opt selectedPasture = pastureLabelToName[label] or "Pasture_1" end, }) SheepTab:CreateToggle({ Name = "Use best owned pasture", CurrentValue = false, Flag = "GrazeUseBest", Callback = function(v) useBestPasture = v end, }) SheepTab:CreateSlider({ Name = "Safety timeout per phase (s)", Range = { 15, 180 }, Increment = 5, CurrentValue = 45, Flag = "GrazeSafety", Callback = function(v) grazeSafety = v end, }) SheepTab:CreateToggle({ Name = "Auto Graze Farm", CurrentValue = false, Flag = "AutoGraze", Callback = function(state) autoGraze = state grazeGen = grazeGen + 1 local myGen = grazeGen if not autoGraze then return end task.spawn(function() runGrazeLoop(myGen) end) end, }) local TeleportTab = Window:CreateTab("Teleport", 4483362458) -- Move to a CFrame if we have a live character. local function tpTo(cf) local hrp = LP.Character and LP.Character:FindFirstChild("HumanoidRootPart") if hrp and cf then hrp.CFrame = cf end end local function tpToPart(part) if not (part and part:IsA("BasePart")) then return end local params = RaycastParams.new() params.FilterType = Enum.RaycastFilterType.Exclude params.FilterDescendantsInstances = { LP.Character, part } local origin = part.Position + Vector3.new(0, math.max(part.Size.Y, 10), 0) local hit = workspace:Raycast(origin, Vector3.new(0, -(part.Size.Y * 2 + 400), 0), params) local y = hit and (hit.Position.Y + 4) or (part.Position.Y + 4) tpTo(CFrame.new(part.Position.X, y, part.Position.Z)) end TeleportTab:CreateSection("Home") -- Anchor inside YOUR fold: the "BuildingPosition" part (fall back to "Zone"). TeleportTab:CreateButton({ Name = "๐Ÿ  My Sheepfold", Callback = function() local fold = findOwnedFold() local anchor = fold and (fold:FindFirstChild("BuildingPosition") or fold:FindFirstChild("Zone")) if anchor then tpToPart(anchor) else Rayfield:Notify({ Title = "Teleport", Content = "Your sheepfold was not found.", Duration = 4 }) end end, }) TeleportTab:CreateSection("Pastures") for _, name in ipairs(PASTURE_ORDER) do local num = name:match("%d+") local locked = not unlockedAtLoad[name] local price = PASTURE_PRICE[name] local label = string.format("Pasture %s %s%s", num, locked and "๐Ÿ”’ " or "", price == 0 and "(free)" or ("($" .. price .. ")")) TeleportTab:CreateButton({ Name = label, Callback = function() local cf = pastureTeleportCFrame(name) if cf then tpTo(cf) else Rayfield:Notify({ Title = "Teleport", Content = name .. " not found in workspace.", Duration = 4 }) end end, }) end TeleportTab:CreateSection("Islands & Zones") -- part name in workspace -> button label local LANDMARKS = { { part = "VolcanicIslandSpawn", label = "๐ŸŒ‹ Volcano Island" }, { part = "VolcanicSheepZone", label = "๐ŸŒ‹ Volcanic Sheep Zone" }, { part = "SheepIslandSpawn", label = "๐Ÿ‘ Sheep Island" }, { part = "SpawnLocation", label = "๐Ÿ  Back to Spawn" }, } for _, m in ipairs(LANDMARKS) do TeleportTab:CreateButton({ Name = m.label, Callback = function() local part = workspace:FindFirstChild(m.part) if part then tpToPart(part) else Rayfield:Notify({ Title = "Teleport", Content = m.part .. " not found in workspace.", Duration = 4 }) end end, }) end -- TAB 4 โ€” PLAYER local PlayerTab = Window:CreateTab("Player", 4483362458) PlayerTab:CreateSection("Character") local walkSpeed = 16 local function applyWalkSpeed() local char = LP.Character local hum = char and char:FindFirstChildWhichIsA("Humanoid") if hum then hum.WalkSpeed = walkSpeed end end LP.CharacterAdded:Connect(function() task.wait(0.5) applyWalkSpeed() end) PlayerTab:CreateSlider({ Name = "Walk Speed", Range = { 16, 200 }, Increment = 1, CurrentValue = 16, Flag = "WalkSpeed", Callback = function(v) walkSpeed = v; applyWalkSpeed() end, }) local ESPTab = Window:CreateTab("ESP", 4483362458) local ESP_GUI_NAME = "FabronSheepESP" local espGUIs = {} -- [cube] = BillboardGui local espOn = false local espGen = 0 -- generation token; stale loops exit on bump local espShow = { hunger = true, wool = true, pregnant = true } local function hex(c) return string.format("#%02X%02X%02X", math.floor(c.R * 255 + 0.5), math.floor(c.G * 255 + 0.5), math.floor(c.B * 255 + 0.5)) end -- Low Hunger = hungry (red), full = fed (green). Same green-good ramp for Wool. local function meterColor(v) local t = math.clamp((v or 0) / 100, 0, 1) return Color3.fromRGB(math.floor(220 * (1 - t)), math.floor(200 * t + 40), 50) end local function makeESP(cube) local bb = Instance.new("BillboardGui") bb.Name = ESP_GUI_NAME bb.Adornee = cube bb.Size = UDim2.new(0, 150, 0, 50) bb.StudsOffset = Vector3.new(0, 2.8, 0) bb.AlwaysOnTop = true bb.MaxDistance = 600 local lbl = Instance.new("TextLabel") lbl.Name = "Info" lbl.BackgroundTransparency = 1 lbl.Size = UDim2.new(1, 0, 1, 0) lbl.Font = Enum.Font.GothamBold lbl.TextSize = 13 lbl.RichText = true lbl.TextColor3 = Color3.fromRGB(255, 255, 255) lbl.TextStrokeTransparency = 0.35 lbl.Parent = bb bb.Parent = cube return bb end local function updateESP(cube, bb) local lbl = bb:FindFirstChild("Info") if not lbl then return end local name = cube:GetAttribute("SheepName") or "Sheep" local baby = cube:GetAttribute("Baby") == true local title = baby and (name .. " (Baby)") or name local lines = { title } if espShow.hunger then local h = math.floor(cube:GetAttribute("Hunger") or 0) lines[#lines + 1] = string.format("๐Ÿ– %d", hex(meterColor(h)), h) end if espShow.wool then local w = math.floor(cube:GetAttribute("Wool") or 0) lines[#lines + 1] = string.format("๐Ÿงถ %d", hex(meterColor(w)), w) end if espShow.pregnant and cube:GetAttribute("Pregnant") == true then lines[#lines + 1] = "๐Ÿคฐ Pregnant" end lbl.Text = table.concat(lines, "\n") -- grow the billboard so each stacked line keeps a readable size bb.Size = UDim2.new(0, 150, 0, 16 * #lines + 6) end local function clearESP() for cube, bb in pairs(espGUIs) do if bb then bb:Destroy() end espGUIs[cube] = nil end end local function espPass() local CS = workspace:FindFirstChild("CubeSheep") if not CS then return end local present = {} for _, cube in ipairs(CS:GetChildren()) do if cube:IsA("BasePart") and cube.Name == "Cube" and cube:GetAttribute("Owner") == LP.UserId and cube:GetAttribute("SheepName") then present[cube] = true local bb = espGUIs[cube] if not bb or not bb.Parent then bb = makeESP(cube) espGUIs[cube] = bb end updateESP(cube, bb) end end -- drop GUIs for sheep we no longer own / that despawned for cube, bb in pairs(espGUIs) do if not present[cube] then if bb then bb:Destroy() end espGUIs[cube] = nil end end end ESPTab:CreateSection("Sheep ESP (your flock)") ESPTab:CreateParagraph({ Title = "Owned-sheep ESP", Content = "Floating label over each sheep YOU own: hunger, wool, and a pregnant tag.", }) ESPTab:CreateToggle({ Name = "Show Hunger", CurrentValue = true, Flag = "ESPHunger", Callback = function(v) espShow.hunger = v end, }) ESPTab:CreateToggle({ Name = "Show Wool", CurrentValue = true, Flag = "ESPWool", Callback = function(v) espShow.wool = v end, }) ESPTab:CreateToggle({ Name = "Show Pregnant", CurrentValue = true, Flag = "ESPPregnant", Callback = function(v) espShow.pregnant = v end, }) ESPTab:CreateToggle({ Name = "Enable Sheep Stat ESP", CurrentValue = false, Flag = "ESPEnable", Callback = function(state) espOn = state espGen = espGen + 1 local myGen = espGen if not espOn then clearESP() return end task.spawn(function() while espOn and myGen == espGen do espPass() task.wait(0.3) end if myGen == espGen and not espOn then clearESP() end end) end, }) -- Live HUD updater task.spawn(function() while task.wait(0.5) do moneyLabel:Set("Money: " .. tostring(LP.Money.Value)) statusLabel:Set("Gained this session: " .. totalGained) end end)