Advertisement
timmie140

BSS(testing)

Nov 27th, 2024 (edited)
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 101.83 KB | None | 0 0
  1. repeat task.wait(0.5) until game:IsLoaded()
  2.  
  3. getgenv().Star = "⭐"
  4. getgenv().Danger = "⚠️"
  5. getgenv().ExploitSpecific = "📜"
  6.  
  7. -- API Calls
  8. local library = loadstring(game:HttpGet("https://pastebin.com/raw/kk6TYGLU", true))() -- Make sure the URL is valid
  9. getgenv().api = loadstring(game:HttpGet("https://pastebin.com/raw/ppB0aP2V", true))()
  10. local bssapi = loadstring(game:HttpGet("https://pastebin.com/raw/fb42MMty", true))() -- Ensure the correct library
  11.  
  12. -- Ensure folder existence
  13. if not isfolder("ZenX") then
  14.     makefolder("ZenX")
  15. end
  16.  
  17. -- Script temporary variables
  18. local playerstatsevent = game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("RetrievePlayerStats")
  19. local statstable = playerstatsevent:InvokeServer()
  20. local monsterspawners = game:GetService("Workspace"):WaitForChild("MonsterSpawners")
  21. local rarename
  22.  
  23. -- Function to retrieve player stats
  24. function rtsg()
  25.     return playerstatsevent:InvokeServer()
  26. end
  27.  
  28. -- Function to equip a mask
  29. function maskequip(mask)
  30.     local ohString1 = "Equip"
  31.     local ohTable2 = {
  32.         ["Mute"] = false,
  33.         ["Type"] = mask,
  34.         ["Category"] = "Accessory"
  35.     }
  36.     game:GetService("ReplicatedStorage").Events.ItemPackageEvent:InvokeServer(ohString1, ohTable2)
  37. end
  38.  
  39. local lasttouched = nil
  40. local done = true
  41. local hi = false
  42.  
  43. -- Load item types and stats cache
  44. local Items = require(game:GetService("ReplicatedStorage"):WaitForChild("EggTypes")).GetTypes()
  45. local v1 = require(game:GetService("ReplicatedStorage"):WaitForChild("ClientStatCache")):Get()
  46.  
  47. -- Automatically claim an unoccupied hive
  48. local hives = game:GetService("Workspace"):WaitForChild("Honeycombs"):GetChildren()
  49. for i = #hives, 1, -1 do
  50.     local hive = hives[i]
  51.     if hive:FindFirstChild("Owner") and hive.Owner.Value == nil then
  52.         game:GetService("ReplicatedStorage").Events.ClaimHive:FireServer(hive.HiveID.Value)
  53.     end
  54. end
  55.  
  56.  
  57. -- Cleanup ZenX UI
  58. for _, v in pairs(game:GetService("CoreGui"):GetDescendants()) do
  59.     if v:IsA("TextLabel") and string.find(v.Text, "ZenX v") then
  60.         v.Parent.Parent:Destroy()
  61.     end
  62. end
  63.  
  64. -- Global table to manage script settings and states
  65. getgenv().temptable = {
  66.     version = "3.4.0",
  67.     blackfield = "Sunflower Field",
  68.     redfields = {},
  69.     bluefields = {},
  70.     whitefields = {},
  71.     shouldiconvertballoonnow = false,
  72.     balloondetected = false,
  73.     puffshroomdetected = false,
  74.     magnitude = 60,
  75.     blacklist = {""},
  76.     running = false,
  77.     configname = "",
  78.     tokenpath = game:GetService("Workspace"):WaitForChild("Collectibles"),
  79.     started = {
  80.         vicious = false,
  81.         mondo = false,
  82.         windy = false,
  83.         ant = false,
  84.         monsters = false
  85.     },
  86.     detected = {
  87.         vicious = false,
  88.         windy = false
  89.     },
  90.     tokensfarm = false,
  91.     converting = false,
  92.     consideringautoconverting = false,
  93.     honeystart = 0,
  94.     grib = nil,
  95.     gribpos = CFrame.new(0, 0, 0),
  96.     honeycurrent = statstable.Totals.Honey,
  97.     dead = false,
  98.     float = false,
  99.     pepsigodmode = false,
  100.     pepsiautodig = false,
  101.     alpha = false,
  102.     beta = false,
  103.     myhiveis = false,
  104.     invis = false,
  105.     windy = nil,
  106.     sprouts = {
  107.         detected = false,
  108.         coords = {}
  109.     },
  110.     cache = {
  111.         autofarm = false,
  112.         killmondo = false,
  113.         vicious = false,
  114.         windy = false
  115.     },
  116.     allplanters = {},
  117.     planters = {
  118.         planter = {},
  119.         cframe = {},
  120.         activeplanters = {
  121.             type = {},
  122.             id = {}
  123.         }
  124.     },
  125.     monstertypes = {"Ladybug", "Rhino", "Spider", "Scorpion", "Mantis", "Werewolf"},
  126.    
  127.     -- Find the closest planter bulb
  128.     ["stopapypa"] = function(path, part)
  129.         local closest
  130.         for _, v in pairs(path:GetChildren()) do
  131.             if v.Name ~= "PlanterBulb" and v:FindFirstChild("Soil") then
  132.                 if not closest or (part.Position - v.Soil.Position).magnitude < (part.Position - closest.Position).magnitude then
  133.                     closest = v.Soil
  134.                 end
  135.             end
  136.         end
  137.         return closest
  138.     end,
  139.    
  140.     coconuts = {},
  141.     crosshairs = {},
  142.     crosshair = false,
  143.     coconut = false,
  144.     act = 0,
  145.     act2 = 0,
  146.  
  147.     -- Handle touched function
  148.     ['touchedfunction'] = function(v)
  149.         if lasttouched ~= v then
  150.             if v.Parent.Name == "FlowerZones" then
  151.                 if v:FindFirstChild("ColorGroup") then
  152.                     local colorGroup = tostring(v.ColorGroup.Value)
  153.                     if colorGroup == "Red" then
  154.                         maskequip("Demon Mask")
  155.                     elseif colorGroup == "Blue" then
  156.                         maskequip("Diamond Mask")
  157.                     end
  158.                 else
  159.                     maskequip("Gummy Mask")
  160.                 end
  161.                 lasttouched = v
  162.             end
  163.         end
  164.     end,
  165.  
  166.     runningfor = 0,
  167.     oldtool = rtsg()["EquippedCollector"],
  168.    
  169.     -- Generate a CFrame offset
  170.     ['gacf'] = function(part, st)
  171.         return CFrame.new(part.Position.X, part.Position.Y + st, part.Position.Z)
  172.     end
  173. }
  174.  
  175.  
  176. local planterst = {
  177.     plantername = {},
  178.     planterid = {}
  179. }
  180.  
  181. -- Check if the player is blacklisted
  182. for _, v in pairs(temptable.blacklist) do
  183.     if v == api.nickname then
  184.         game.Players.LocalPlayer:Kick("You're blacklisted! Get clapped!")
  185.         return -- Ensures script stops executing
  186.     end
  187. end
  188.  
  189. -- Initialize honeystart if it hasn't been set yet
  190. if temptable.honeystart == 0 then
  191.     temptable.honeystart = statstable.Totals.Honey
  192. end
  193.  
  194. -- Rename "TimerAttachment" to "Attachment" in MonsterSpawners
  195. for _, v in pairs(game:GetService("Workspace").MonsterSpawners:GetDescendants()) do
  196.     if v.Name == "TimerAttachment" then
  197.         v.Name = "Attachment"
  198.     end
  199. end
  200.  
  201. -- Rename specific MonsterSpawner objects for consistency
  202. for _, v in pairs(game:GetService("Workspace").MonsterSpawners:GetChildren()) do
  203.     if v.Name == "RoseBush" then
  204.         v.Name = "ScorpionBush"
  205.     elseif v.Name == "RoseBush2" then
  206.         v.Name = "ScorpionBush2"
  207.     end
  208. end
  209.  
  210. -- Categorize FlowerZones into red, blue, and white fields
  211. for _, v in pairs(game:GetService("Workspace").FlowerZones:GetChildren()) do
  212.     if v:FindFirstChild("ColorGroup") then
  213.         local colorGroup = v:FindFirstChild("ColorGroup").Value
  214.         if colorGroup == "Red" then
  215.             table.insert(temptable.redfields, v.Name)
  216.         elseif colorGroup == "Blue" then
  217.             table.insert(temptable.bluefields, v.Name)
  218.         end
  219.     else
  220.         table.insert(temptable.whitefields, v.Name)
  221.     end
  222. end
  223.  
  224. local flowertable = {}
  225. -- Populate flowertable with the positions of all flowers
  226. for _, flower in pairs(game:GetService("Workspace").Flowers:GetChildren()) do
  227.     table.insert(flowertable, flower.Position)
  228. end
  229.  
  230. local masktable = {}
  231. -- Populate masktable with all masks in the Accessories folder
  232. for _, accessory in pairs(game:GetService("ReplicatedStorage").Accessories:GetChildren()) do
  233.     if string.match(accessory.Name, "Mask") then
  234.         table.insert(masktable, accessory.Name)
  235.     end
  236. end
  237.  
  238. local collectorstable = {}
  239. -- Populate collectorstable with the names of all collectors
  240. for _, collector in pairs(getupvalues(require(game:GetService("ReplicatedStorage").Collectors).Exists)) do
  241.     for collectorName, _ in pairs(collector) do
  242.         table.insert(collectorstable, collectorName)
  243.     end
  244. end
  245.  
  246. local fieldstable = {}
  247. -- Populate fieldstable with the names of all FlowerZones
  248. for _, field in pairs(game:GetService("Workspace").FlowerZones:GetChildren()) do
  249.     table.insert(fieldstable, field.Name)
  250. end
  251.  
  252. local toystable = {}
  253. -- Populate toystable with the names of all Toys
  254. for _, toy in pairs(game:GetService("Workspace").Toys:GetChildren()) do
  255.     table.insert(toystable, toy.Name)
  256. end
  257.  
  258. local spawnerstable = {}
  259. -- Populate spawnerstable with the names of all MonsterSpawners
  260. for _, spawner in pairs(game:GetService("Workspace").MonsterSpawners:GetChildren()) do
  261.     table.insert(spawnerstable, spawner.Name)
  262. end
  263.  
  264. local accesoriestable = {}
  265. -- Populate accesoriestable with the names of all accessories excluding "UpdateMeter"
  266. for _, accessory in pairs(game:GetService("ReplicatedStorage").Accessories:GetChildren()) do
  267.     if accessory.Name ~= "UpdateMeter" then
  268.         table.insert(accesoriestable, accessory.Name)
  269.     end
  270. end
  271.  
  272. -- Populate temptable.allplanters with the names of all planters from PlanterTypes
  273. for _, planterType in pairs(getupvalues(require(game:GetService("ReplicatedStorage").PlanterTypes).GetTypes)) do
  274.     for planterName, _ in pairs(planterType) do
  275.         table.insert(temptable.allplanters, planterName)
  276.     end
  277. end
  278.  
  279. local donatableItemsTable = {}
  280. local treatsTable = {}
  281.  
  282. -- Populate donatableItemsTable with items that can be donated to Wind Shrine
  283. for itemName, item in pairs(Items) do
  284.     if item.DonatableToWindShrine then
  285.         table.insert(donatableItemsTable, itemName)
  286.     end
  287. end
  288.  
  289. -- Populate treatsTable with items that have TreatValue
  290. for itemName, item in pairs(Items) do
  291.     if item.TreatValue then
  292.         table.insert(treatsTable, itemName)
  293.     end
  294. end
  295.  
  296. -- Buff table with items and their decal IDs
  297. local buffTable = {
  298.     ["Blue Extract"] = {b = false, DecalID = "2495936060"},
  299.     ["Red Extract"] = {b = false, DecalID = "2495935291"},
  300.     ["Oil"] = {b = false, DecalID = "2545746569"},
  301.     ["Enzymes"] = {b = false, DecalID = "2584584968"},
  302.     ["Glue"] = {b = false, DecalID = "2504978518"},
  303.     ["Glitter"] = {b = false, DecalID = "2542899798"},
  304.     ["Tropical Drink"] = {b = false, DecalID = "3835877932"}
  305. }
  306.  
  307. -- Get accessory types and mask names
  308. local AccessoryTypes = require(game:GetService("ReplicatedStorage").Accessories).GetTypes()
  309. local MasksTable = {}
  310.  
  311. for maskName, _ in pairs(AccessoryTypes) do
  312.     if string.find(maskName, "Mask") and maskName ~= "Honey Mask" then
  313.         table.insert(MasksTable, maskName)
  314.     end
  315. end
  316.  
  317. -- Sort the various tables
  318. table.sort(fieldstable)
  319. table.sort(accesoriestable)
  320. table.sort(toystable)
  321. table.sort(spawnerstable)
  322. table.sort(masktable)
  323. table.sort(temptable.allplanters)
  324. table.sort(collectorstable)
  325. table.sort(donatableItemsTable)
  326. table.sort(buffTable)
  327. table.sort(MasksTable)
  328.  
  329. -- Function to convert honey
  330. function converthoney()
  331.     task.wait(0)
  332.     if temptable.converting then
  333.         local playerGui = game.Players.LocalPlayer.PlayerGui.ScreenGui
  334.         local activateButton = playerGui.ActivateButton
  335.         local playerPosition = game.Players.LocalPlayer.SpawnPos.Value.Position
  336.         local characterPosition = game.Players.LocalPlayer.Character.HumanoidRootPart.Position
  337.  
  338.         -- Check if honey making is active and if conditions are met to toggle it
  339.         if activateButton.TextBox.Text ~= "Stop Making Honey" and activateButton.BackgroundColor3 ~= Color3.new(201, 39, 28)
  340.             or (playerPosition - characterPosition).magnitude > 13 then
  341.            
  342.             api.tween(1, playerPosition * CFrame.fromEulerAnglesXYZ(0, 110, 0) + Vector3.new(0, 0, 9))
  343.             task.wait(0.9)
  344.            
  345.             if activateButton.TextBox.Text ~= "Stop Making Honey" and activateButton.BackgroundColor3 ~= Color3.new(201, 39, 28)
  346.                 or (playerPosition - characterPosition).magnitude > 13 then
  347.                
  348.                 game:GetService("ReplicatedStorage").Events.PlayerHiveCommand:FireServer("ToggleHoneyMaking")
  349.             end
  350.             task.wait(0.1)
  351.         end
  352.     end
  353. end
  354.  
  355. -- Function to find and farm the closest flower
  356. function closestleaf()
  357.     for _, flower in pairs(game.Workspace.Flowers:GetChildren()) do
  358.         if not temptable.running and (flower.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude < temptable.magnitude / 1.4 then
  359.             farm(flower)
  360.             break
  361.         end
  362.     end
  363. end
  364.  
  365. -- Float Pad
  366. local floatpad = Instance.new("Part")
  367. floatpad.Name = "FloatPad"
  368. floatpad.Parent = game:GetService("Workspace")
  369. floatpad.CanCollide = false
  370. floatpad.Anchored = true
  371. floatpad.Transparency = 1
  372. floatpad.Size = Vector3.new(10, 1, 10)  -- You can adjust the size if needed
  373.  
  374. -- Coconut Part
  375. local cocopad = Instance.new("Part")
  376. cocopad.Name = "Coconut Part"
  377. cocopad.Parent = game:GetService("Workspace")
  378. cocopad.Anchored = true
  379. cocopad.Transparency = 1
  380. cocopad.Size = Vector3.new(10, 1, 10)  -- Adjust size if necessary
  381. cocopad.Position = Vector3.new(-307.52117919922, 105.91863250732, 467.86791992188)
  382.  
  383. -- Ant Autofarm Part
  384. local antpart = Instance.new("Part")
  385. antpart.Name = "Ant Autofarm Part"
  386. antpart.Parent = workspace
  387. antpart.Position = Vector3.new(96, 47, 553)
  388. antpart.Anchored = true
  389. antpart.Size = Vector3.new(128, 1, 50)
  390. antpart.Transparency = 1
  391. antpart.CanCollide = false
  392.  
  393. -- ZenX Configuration Table
  394. getgenv().ZenX = {
  395.     rares = {},  -- Store rare items or collectibles
  396.     priority = {},  -- Items or fields with priority
  397.     bestfields = {
  398.         red = "Pepper Patch",  -- Best field for red items
  399.         white = "Coconut Field",  -- Best field for white items
  400.         blue = "Stump Field"  -- Best field for blue items
  401.     },
  402.     blacklistedfields = {},  -- Fields that are blacklisted
  403.     killerZenX = {},  -- Custom ZenX killers
  404.     bltokens = {},  -- Blacklisted tokens
  405.     toggles = {
  406.         farmduped = false,  -- Toggle for farming duplicated items
  407.         autofarm = false,  -- Toggle for automatic farming
  408.         farmclosestleaf = false,  -- Toggle for farming the closest leaf
  409.         farmbubbles = false,  -- Toggle for farming bubbles
  410.         autodig = false,  -- Toggle for auto-digging
  411.         farmrares = false,  -- Toggle for farming rare items
  412.         rgbui = false,  -- Toggle for RGB UI
  413.         farmflower = false,  -- Toggle for farming flowers
  414.         farmfuzzy = false,  -- Toggle for farming fuzzy items
  415.         farmcoco = false,  -- Toggle for farming coconuts
  416.         farmflame = false,  -- Toggle for farming flame items
  417.         farmclouds = false,  -- Toggle for farming clouds
  418.         killmondo = false,  -- Toggle for killing Mondo
  419.         killvicious = false,  -- Toggle for killing Vicious
  420.         loopspeed = false,  -- Toggle for loop speed
  421.         loopjump = false,  -- Toggle for loop jump
  422.         autoquest = false,  -- Toggle for auto quests
  423.         autoboosters = false,  -- Toggle for auto boosters
  424.         autodispense = false,  -- Toggle for auto dispensing
  425.         clock = false,  -- Toggle for clock-related features
  426.         freeantpass = false,  -- Toggle for free ant pass
  427.         honeystorm = false,  -- Toggle for honey storm
  428.         autodoquest = false,  -- Toggle for auto doing quests
  429.         disableseperators = false,  -- Disable separators
  430.         npctoggle = false,  -- Toggle NPC actions
  431.         loopfarmspeed = false,  -- Toggle for farming speed
  432.         mobquests = false,  -- Toggle for mob quests
  433.         traincrab = false,  -- Toggle for crab training
  434.         avoidmobs = false,  -- Toggle for avoiding mobs
  435.         farmsprouts = false,  -- Toggle for farming sprouts
  436.         enabletokenblacklisting = false,  -- Enable token blacklisting
  437.         farmunderballoons = false,  -- Toggle for farming under balloons
  438.         farmsnowflakes = false,  -- Toggle for farming snowflakes
  439.         collectgingerbreads = false,  -- Toggle for collecting gingerbreads
  440.         collectcrosshairs = false,  -- Toggle for collecting crosshairs
  441.         farmpuffshrooms = false,  -- Toggle for farming puffshrooms
  442.         tptonpc = false,  -- Toggle for teleporting to NPCs
  443.         donotfarmtokens = false,  -- Toggle to avoid farming tokens
  444.         convertballoons = false,  -- Toggle for converting balloons
  445.         autostockings = false,  -- Toggle for auto stockings
  446.         autosamovar = false,  -- Toggle for auto samovars
  447.         autoonettart = false,  -- Toggle for auto onettarts
  448.         autocandles = false,  -- Toggle for auto candles
  449.         autofeast = false,  -- Toggle for auto feasts
  450.         autoplanters = false,  -- Toggle for auto planters
  451.         autokillmobs = false,  -- Toggle for killing mobs
  452.         autoant = false,  -- Toggle for auto-ant
  453.         killwindy = false,  -- Toggle for killing Windy
  454.         godmode = false,  -- Toggle for godmode
  455.         disableconversion = false,  -- Disable honey conversion
  456.         autodonate = false,  -- Toggle for auto donation
  457.         autouseconvertors = false,  -- Auto use converters
  458.         honeymaskconv = false,  -- Toggle for honey mask conversion
  459.         resetbeeenergy = false,  -- Reset bee energy
  460.         enablestatuspanel = false,  -- Enable status panel
  461.     },
  462.     vars = {
  463.         field = "Ant Field",  -- Default field
  464.         convertat = 100,  -- Conversion threshold
  465.         farmspeed = 60,  -- Farming speed
  466.         prefer = "Tokens",  -- Preferred item to farm
  467.         walkspeed = 70,  -- Walk speed
  468.         jumppower = 70,  -- Jump power
  469.         npcprefer = "All Quests",  -- Preferred NPC quests
  470.         farmtype = "Walk",  -- Farm type (e.g., walk or teleport)
  471.         monstertimer = 3,  -- Timer for monster spawns
  472.         autodigmode = "Normal",  -- Auto-dig mode
  473.         donoItem = "Coconut",  -- Donation item
  474.         donoAmount = 25,  -- Donation amount
  475.         selectedTreat = "Treat",  -- Selected treat
  476.         selectedTreatAmount = 0,  -- Amount of selected treat
  477.         autouseMode = "Just Tickets",  -- Auto-use mode for items
  478.         autoconvertWaitTime = 10,  -- Wait time before auto-conversion
  479.         defmask = "Bubble",  -- Default mask
  480.         resettimer = 3,  -- Timer to reset settings
  481.     },
  482.     dispensesettings = {
  483.         blub = false,  -- Dispense blue items
  484.         straw = false,  -- Dispense straw
  485.         treat = false,  -- Dispense treats
  486.         coconut = false,  -- Dispense coconuts
  487.         glue = false,  -- Dispense glue
  488.         rj = false,  -- Dispense royal jelly
  489.         white = false,  -- Dispense white items
  490.         red = false,  -- Dispense red items
  491.         blue = false,  -- Dispense blue items
  492.     }
  493. }
  494.  
  495. -- Save the default ZenX configuration
  496. local defaultZenX = ZenX
  497.  
  498. -- Functions
  499.  
  500. -- Get player stats from the StatCache
  501. function statsget()
  502.     local StatCache = require(game.ReplicatedStorage.ClientStatCache)
  503.     local stats = StatCache:Get()
  504.     return stats
  505. end
  506.  
  507. -- Function to farm a given position (usually a token or collectible)
  508. function farm(trying)
  509.     -- Set the walk speed for farming if enabled in settings
  510.     if ZenX.toggles.loopfarmspeed then
  511.         game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = ZenX.vars.farmspeed
  512.     end
  513.    
  514.     -- Move the character to the target position
  515.     api.humanoid():MoveTo(trying.Position)
  516.    
  517.     -- Wait until the player reaches the target position or a condition is met
  518.     repeat
  519.         task.wait()
  520.     until (trying.Position - api.humanoidrootpart().Position).magnitude <= 4 or not IsToken(trying) or not temptable.running
  521. end
  522.  
  523. -- Disable all active toggles when needed
  524. function disableall()
  525.     -- Disable autofarm if it's enabled and not currently converting
  526.     if ZenX.toggles.autofarm and not temptable.converting then
  527.         temptable.cache.autofarm = true
  528.         ZenX.toggles.autofarm = false
  529.     end
  530.  
  531.     -- Disable kill toggles for Mondo, Vicious, and Windy if they haven't started
  532.     if ZenX.toggles.killmondo and not temptable.started.mondo then
  533.         ZenX.toggles.killmondo = false
  534.         temptable.cache.killmondo = true
  535.     end
  536.     if ZenX.toggles.killvicious and not temptable.started.vicious then
  537.         ZenX.toggles.killvicious = false
  538.         temptable.cache.vicious = true
  539.     end
  540.     if ZenX.toggles.killwindy and not temptable.started.windy then
  541.         ZenX.toggles.killwindy = false
  542.         temptable.cache.windy = true
  543.     end
  544. end
  545.  
  546. -- Enable all toggles that were previously disabled
  547. function enableall()
  548.     -- Restore previous settings for toggles
  549.     if temptable.cache.autofarm then
  550.         ZenX.toggles.autofarm = true
  551.         temptable.cache.autofarm = false
  552.     end
  553.     if temptable.cache.killmondo then
  554.         ZenX.toggles.killmondo = true
  555.         temptable.cache.killmondo = false
  556.     end
  557.     if temptable.cache.vicious then
  558.         ZenX.toggles.killvicious = true
  559.         temptable.cache.vicious = false
  560.     end
  561.     if temptable.cache.windy then
  562.         ZenX.toggles.killwindy = true
  563.         temptable.cache.windy = false
  564.     end
  565. end
  566.  
  567. -- Function to get tokens within a specified range (default is `fieldposition`)
  568. function gettoken(v3)
  569.     if not v3 then
  570.         v3 = fieldposition  -- Use a default field position if none is provided
  571.     end
  572.     task.wait()
  573.  
  574.     -- Iterate through all collectibles in the workspace
  575.     for e, r in next, game:GetService("Workspace").Collectibles:GetChildren() do
  576.         local itb = false
  577.        
  578.         -- Check if the token has a blacklisted decal
  579.         if r:FindFirstChildOfClass("Decal") and ZenX.toggles.enabletokenblacklisting then
  580.             local decalId = string.split(r:FindFirstChildOfClass("Decal").Texture, 'rbxassetid://')[2]
  581.             if api.findvalue(ZenX.bltokens, decalId) then
  582.                 itb = true
  583.             end
  584.         end
  585.        
  586.         -- If the token is within range and not blacklisted, farm it
  587.         if tonumber((r.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude) <= temptable.magnitude / 1.4
  588.         and not itb
  589.         and (v3 - r.Position).magnitude <= temptable.magnitude then
  590.             farm(r)
  591.         end
  592.     end
  593. end
  594.  
  595. -- Function to handle sprinkler usage
  596. function makesprinklers()
  597.     local sprinkler = rtsg().EquippedSprinkler  -- Get the equipped sprinkler type
  598.     local e = 1  -- Default number of sprinklers to use
  599.  
  600.     -- Determine the number of sprinklers based on the equipped type
  601.     if sprinkler == "Basic Sprinkler" or sprinkler == "The Supreme Saturator" then
  602.         e = 1
  603.     elseif sprinkler == "Silver Soakers" then
  604.         e = 2
  605.     elseif sprinkler == "Golden Gushers" then
  606.         e = 3
  607.     elseif sprinkler == "Diamond Drenchers" then
  608.         e = 4
  609.     end
  610.  
  611.     -- Use the sprinklers (if more than 1, adjust jump power and wait)
  612.     for i = 1, e do
  613.         local k = api.humanoid().JumpPower  -- Save current jump power
  614.         if e ~= 1 then
  615.             api.humanoid().JumpPower = 70  -- Set jump power for sprinkler use
  616.             api.humanoid().Jump = true  -- Make the character jump
  617.             task.wait(.2)  -- Wait for a moment
  618.         end
  619.  
  620.         -- Trigger the sprinkler action
  621.         game.ReplicatedStorage.Events.PlayerActivesCommand:FireServer({["Name"] = "Sprinkler Builder"})
  622.  
  623.         -- Restore jump power if it was modified
  624.         if e ~= 1 then
  625.             api.humanoid().JumpPower = k
  626.             task.wait(1)  -- Wait for a moment after restoring jump power
  627.         end
  628.     end
  629. end
  630.  
  631. -- Function to kill mobs at specific locations
  632. function killmobs()
  633.     -- Loop through all monster spawners
  634.     for i, v in pairs(game:GetService("Workspace").MonsterSpawners:GetChildren()) do
  635.         if v:FindFirstChild("Territory") then
  636.             -- Skip certain monster names
  637.             if v.Name ~= "Commando Chick" and v.Name ~= "CoconutCrab" and v.Name ~= "StumpSnail" and
  638.                v.Name ~= "TunnelBear" and v.Name ~= "King Beetle Cave" and not v.Name:match("CaveMonster") and
  639.                not v:FindFirstChild("TimerLabel", true).Visible then
  640.  
  641.                 local monsterpart
  642.                 -- Identify the correct monster part to teleport to
  643.                 if v.Name:match("Werewolf") then
  644.                     monsterpart = game:GetService("Workspace").Territories.WerewolfPlateau.w
  645.                 elseif v.Name:match("Mushroom") then
  646.                     monsterpart = game:GetService("Workspace").Territories.MushroomZone.Part
  647.                 else
  648.                     monsterpart = v.Territory.Value
  649.                 end
  650.  
  651.                 -- Move to the monster's territory and avoid mobs
  652.                 api.humanoidrootpart().CFrame = monsterpart.CFrame
  653.                 repeat
  654.                     api.humanoidrootpart().CFrame = monsterpart.CFrame  -- Keep moving to the monster's position
  655.                     avoidmob()  -- Avoid mobs
  656.                     task.wait(1)  -- Wait before checking again
  657.                 until v:FindFirstChild("TimerLabel", true).Visible  -- Wait until the mob's timer is visible
  658.  
  659.                 -- Collect tokens after the mob has been killed
  660.                 for i = 1, 4 do
  661.                     gettoken(monsterpart.Position)
  662.                 end
  663.             end
  664.         end
  665.     end
  666. end
  667.  
  668. -- Function to check if a given token is valid
  669. function IsToken(token)
  670.     -- Return false if token doesn't exist or doesn't meet necessary conditions
  671.     if not token or not token.Parent then
  672.         return false
  673.     end
  674.     -- Ensure the token has a valid orientation and a "FrontDecal" (specific to certain tokens)
  675.     if token.Orientation.Z ~= 0 then
  676.         return false
  677.     end
  678.     if not token:FindFirstChild("FrontDecal") then
  679.         return false
  680.     end
  681.     -- Ensure token is a "Part" and not something else
  682.     if not token:IsA("Part") then
  683.         return false
  684.     end
  685.     return true  -- If all conditions are met, the token is valid
  686. end
  687.  
  688. -- Generic check function to ensure an object exists and is valid
  689. function check(ok)
  690.     if not ok or not ok.Parent then  -- Return false if the object or its parent doesn't exist
  691.         return false
  692.     end
  693.     return true  -- If the object exists, return true
  694. end
  695.  
  696. -- Function to get planters that are fully grown and belong to the player
  697. function getplanters()
  698.     table.clear(planterst.plantername)  -- Clear the planter name table
  699.     table.clear(planterst.planterid)    -- Clear the planter ID table
  700.  
  701.     -- Loop through planters and collect the ones that are fully grown and owned by the player
  702.     for i, v in pairs(debug.getupvalues(require(game:GetService("ReplicatedStorage").LocalPlanters).LoadPlanter)[4]) do
  703.         if v.GrowthPercent == 1 and v.IsMine then  -- Check if the planter is fully grown and belongs to the player
  704.             table.insert(planterst.plantername, v.Type)  -- Add the planter type to the list
  705.             table.insert(planterst.planterid, v.ActorID)  -- Add the planter ID to the list
  706.         end
  707.     end
  708. end
  709.  
  710. -- Function to farm the Ant Challenge by switching tools and moving the character
  711. function farmant()
  712.     -- Enable collision and start the Ant Challenge
  713.     antpart.CanCollide = true
  714.     temptable.started.ant = true
  715.     anttable = {left = true, right = false}  -- Track which side of the challenge the player is on
  716.  
  717.     -- Switch to the Spark Staff for the Ant Challenge
  718.     temptable.oldtool = rtsg()['EquippedCollector']
  719.     game.ReplicatedStorage.Events.ItemPackageEvent:InvokeServer("Equip", {["Mute"] = true, ["Type"] = "Spark Staff", ["Category"] = "Collector"})
  720.     game.ReplicatedStorage.Events.ToyEvent:FireServer("Ant Challenge")  -- Start the Ant Challenge
  721.  
  722.     ZenX.toggles.autodig = true  -- Enable autodig for the Ant Challenge
  723.  
  724.     -- Set CFrames for left and right positions in the Ant Challenge
  725.     local acl = CFrame.new(127, 48, 547)
  726.     local acr = CFrame.new(65, 48, 534)
  727.  
  728.     task.wait(1)  -- Wait a moment before continuing
  729.  
  730.     -- Activate the sprinkler to prepare for farming
  731.     game.ReplicatedStorage.Events.PlayerActivesCommand:FireServer({["Name"] = "Sprinkler Builder"})
  732.  
  733.     -- Move the character upwards to avoid obstacles
  734.     api.humanoidrootpart().CFrame = api.humanoidrootpart().CFrame + Vector3.new(0, 15, 0)
  735.     task.wait(3)  -- Wait for the sprinkler and character movement to settle
  736.  
  737.     -- Main loop to navigate between two positions in the Ant Challenge based on obstacle positions
  738.     repeat
  739.         task.wait()
  740.         for _, v in next, game.Workspace.Toys["Ant Challenge"].Obstacles:GetChildren() do
  741.             if v:FindFirstChild("Root") then
  742.                 if (v.Root.Position - api.humanoidrootpart().Position).magnitude <= 40 and anttable.left then
  743.                     api.humanoidrootpart().CFrame = acr  -- Move to the right position
  744.                     anttable.left = false
  745.                     anttable.right = true
  746.                     wait(.1)
  747.                 elseif (v.Root.Position - api.humanoidrootpart().Position).magnitude <= 40 and anttable.right then
  748.                     api.humanoidrootpart().CFrame = acl  -- Move to the left position
  749.                     anttable.left = true
  750.                     anttable.right = false
  751.                     wait(.1)
  752.                 end
  753.             end
  754.         end
  755.     until game:GetService("Workspace").Toys["Ant Challenge"].Busy.Value == false  -- Wait until the challenge is complete
  756.  
  757.     task.wait(1)  -- Wait before resetting tool
  758.  
  759.     -- Restore the original tool and stop the Ant Challenge
  760.     game.ReplicatedStorage.Events.ItemPackageEvent:InvokeServer("Equip", {["Mute"] = true, ["Type"] = temptable.oldtool, ["Category"] = "Collector"})
  761.     temptable.started.ant = false
  762.     antpart.CanCollide = false  -- Disable collision for the Ant part after farming
  763. end
  764.  
  765. -- Function to collect fully grown planters
  766. function collectplanters()
  767.     getplanters()  -- Get the list of fully grown planters
  768.     for i, v in pairs(planterst.plantername) do
  769.         -- Check if the planter exists and has soil
  770.         local planterPart = api.partwithnamepart(v, game:GetService("Workspace").Planters)
  771.         if planterPart and planterPart:FindFirstChild("Soil") then
  772.             local soil = planterPart.Soil
  773.             api.humanoidrootpart().CFrame = soil.CFrame  -- Move the character to the planter's soil position
  774.  
  775.             -- Collect the planter's items
  776.             game:GetService("ReplicatedStorage").Events.PlanterModelCollect:FireServer(planterst.planterid[i])
  777.             task.wait(0.5)  -- Wait before continuing
  778.  
  779.             -- Activate the planter's action (e.g., watering)
  780.             game:GetService("ReplicatedStorage").Events.PlayerActivesCommand:FireServer({["Name"] = v .. " Planter"})
  781.  
  782.             -- Collect tokens from the planter
  783.             for i = 1, 5 do
  784.                 gettoken(soil.Position)
  785.             end
  786.  
  787.             task.wait(2)  -- Wait before collecting the next planter
  788.         end
  789.     end
  790. end
  791.  
  792. function getprioritytokens()
  793.     task.wait()  -- Allow for other processes to run, but use sparingly
  794.     if not temptable.running then  -- Proceed only if not already running
  795.         for _, r in next, game:GetService("Workspace").Collectibles:GetChildren() do
  796.             if r:FindFirstChildOfClass("Decal") then  -- Ensure the object is a decal
  797.                 local textureId = string.split(r:FindFirstChildOfClass("Decal").Texture, 'rbxassetid://')[2]
  798.                 if textureId and api.findvalue(ZenX.priority, textureId) then  -- Check for priority tokens
  799.                     -- Check if the token belongs to the player and isn't already collected, or if it's within range
  800.                     if (r.Name == game.Players.LocalPlayer.Name and not r:FindFirstChild("got it")) or
  801.                        (tonumber((r.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude) <= temptable.magnitude / 1.4 and not r:FindFirstChild("got it")) then
  802.                         farm(r)  -- Collect the token
  803.                         local val = Instance.new("IntValue", r)  -- Mark it as collected
  804.                         val.Name = "got it"
  805.                         break  -- Exit after collecting the first valid token
  806.                     end
  807.                 end
  808.             end
  809.         end
  810.     end
  811. end
  812.  
  813. function getprioritytokens()
  814.     task.wait()  -- Allow for other processes to run, but use sparingly
  815.     if not temptable.running then  -- Proceed only if not already running
  816.         for _, r in next, game:GetService("Workspace").Collectibles:GetChildren() do
  817.             if r:FindFirstChildOfClass("Decal") then  -- Ensure the object is a decal
  818.                 local textureId = string.split(r:FindFirstChildOfClass("Decal").Texture, 'rbxassetid://')[2]
  819.                 if textureId and api.findvalue(ZenX.priority, textureId) then  -- Check for priority tokens
  820.                     -- Check if the token belongs to the player and isn't already collected, or if it's within range
  821.                     if (r.Name == game.Players.LocalPlayer.Name and not r:FindFirstChild("got it")) or
  822.                        (tonumber((r.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude) <= temptable.magnitude / 1.4 and not r:FindFirstChild("got it")) then
  823.                         farm(r)  -- Collect the token
  824.                         local val = Instance.new("IntValue", r)  -- Mark it as collected
  825.                         val.Name = "got it"
  826.                         break  -- Exit after collecting the first valid token
  827.                     end
  828.                 end
  829.             end
  830.         end
  831.     end
  832. end
  833.  
  834. function getbubble()
  835.     -- Loop through particles to find "Bubble" objects
  836.     for _, v in next, game.Workspace.Particles:GetChildren() do
  837.         if v.Name:match("Bubble") and not temptable.running then  -- Check if the particle is a bubble and not running
  838.             local distance = (v.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude
  839.             if distance < temptable.magnitude / 1.4 then  -- Check if bubble is within range
  840.                 farm(v)  -- Collect the bubble
  841.                 break  -- Exit once a bubble is collected
  842.             end
  843.         end
  844.     end
  845. end
  846.  
  847. function getballoons()
  848.     -- Loop through all field balloons
  849.     for _, v in next, game:GetService("Workspace").Balloons.FieldBalloons:GetChildren() do
  850.         local balloonRoot = v:FindFirstChild("BalloonRoot")
  851.         local playerName = v:FindFirstChild("PlayerName")
  852.        
  853.         if balloonRoot and playerName then  -- Ensure both BalloonRoot and PlayerName exist
  854.             if playerName.Value == game.Players.LocalPlayer.Name then  -- Check if balloon belongs to the player
  855.                 local distance = (balloonRoot.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude
  856.                 if distance < temptable.magnitude / 1.4 then  -- Check if balloon is within range
  857.                     api.walkTo(balloonRoot.Position)  -- Move towards the balloon
  858.                 end
  859.             end
  860.         end
  861.     end
  862. end
  863.  
  864. function getflower()
  865.     -- Ensure flowertable and fieldposition are valid
  866.     if #flowertable == 0 or not fieldposition then
  867.         return
  868.     end
  869.  
  870.     -- Randomly pick a flower from the flower table
  871.     local flowerrrr = flowertable[math.random(#flowertable)]
  872.  
  873.     -- Calculate distances from the flower to the player and to the field position
  874.     local flowerToPlayerDistance = (flowerrrr - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude
  875.     local flowerToFieldDistance = (flowerrrr - fieldposition).magnitude
  876.  
  877.     -- Check if flower is within range of the player and field
  878.     if flowerToPlayerDistance <= temptable.magnitude / 1.4 and flowerToFieldDistance <= temptable.magnitude / 1.4 then
  879.         -- Only move if not already running
  880.         if not temptable.running then
  881.             -- Adjust walk speed if the toggle is enabled
  882.             if ZenX.toggles.loopfarmspeed then
  883.                 game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = ZenX.vars.farmspeed
  884.             end
  885.  
  886.             -- Move towards the flower
  887.             api.walkTo(flowerrrr)
  888.         end
  889.     end
  890. end
  891.  
  892. function getcloud()
  893.     -- Ensure temptable.magnitude is valid
  894.     if not temptable.magnitude then
  895.         return
  896.     end
  897.  
  898.     -- Loop through all clouds in the workspace
  899.     for _, v in next, game:GetService("Workspace").Clouds:GetChildren() do
  900.         local plane = v:FindFirstChild("Plane")
  901.  
  902.         -- Only proceed if the Plane exists and the distance is within range
  903.         if plane then
  904.             local distanceToPlane = (plane.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude
  905.             if distanceToPlane < temptable.magnitude / 1.4 then
  906.                 -- Move towards the plane's position
  907.                 api.walkTo(plane.Position)
  908.                 return  -- Exit the loop after finding and moving to the cloud
  909.             end
  910.         end
  911.     end
  912. end
  913.  
  914. function getcoco(v)
  915.     -- If coconut is being processed, wait until it's free
  916.     if temptable.coconut then
  917.         repeat task.wait() until not temptable.coconut
  918.     end
  919.  
  920.     -- Mark coconut as being processed
  921.     temptable.coconut = true
  922.  
  923.     -- Move to the coconut's position with a smooth transition
  924.     api.tween(0.1, v.CFrame)
  925.  
  926.     -- Wait until the player reaches the coconut's position, checking if the coconut is still valid
  927.     repeat
  928.         task.wait()
  929.         api.walkTo(v.Position)
  930.     until not v.Parent  -- Exit if coconut is no longer in the game
  931.  
  932.     -- Wait a small period before resetting
  933.     task.wait(0.1)
  934.  
  935.     -- Mark coconut as processed
  936.     temptable.coconut = false
  937.  
  938.     -- Remove coconut from the list
  939.     local coconutIndex = table.find(temptable.coconuts, v)
  940.     if coconutIndex then
  941.         table.remove(temptable.coconuts, coconutIndex)
  942.     end
  943. end
  944.  
  945. function getfuzzy()
  946.     pcall(function()
  947.         -- Loop through all particles
  948.         for _, v in next, game.Workspace.Particles:GetChildren() do
  949.             -- Check for DustBunnyInstance and if conditions match
  950.             if v.Name == "DustBunnyInstance" and not temptable.running then
  951.                 local plane = v:FindFirstChild("Plane")
  952.                 if plane and tonumber((plane.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude) < temptable.magnitude / 1.4 then
  953.                     -- Call farm function on the plane
  954.                     farm(plane)
  955.                     break
  956.                 end
  957.             end
  958.         end
  959.     end)
  960. end
  961.  
  962. function getflame()
  963.     pcall(function()
  964.         -- Loop through all PlayerFlames
  965.         for _, v in next, game:GetService("Workspace").PlayerFlames:GetChildren() do
  966.             -- Check if the flame is within range
  967.             if tonumber((v.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude) < temptable.magnitude / 1.4 then
  968.                 -- Call farm function on the flame
  969.                 farm(v)
  970.                 break
  971.             end
  972.         end
  973.     end)
  974. end
  975.  
  976. function getdupe()
  977.     for _, v in next, game:GetService("Workspace").Camera.DupedTokens:GetChildren() do
  978.         -- Check if the token is within a 25 stud radius
  979.         if tonumber((v.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude) < 25 then
  980.             -- Check for specific texture IDs
  981.             if string.find(v.FrontDecal.Texture, "5877939956") or string.find(v.FrontDecal.Texture, "1629547638") then
  982.                 -- Move the token downward and give it a unique hash name
  983.                 v.CFrame = v.CFrame - Vector3.new(0, 5, 0)
  984.                 local hash = tostring(math.random(1, 10000))
  985.                 v.Name = hash
  986.  
  987.                 -- Keep the player floating on the token's position
  988.                 repeat
  989.                     wait(0.05)
  990.                     getgenv().temptable.float = true
  991.                     game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = v.CFrame
  992.                 until not game:GetService("Workspace").Camera.DupedTokens:FindFirstChild(hash)
  993.  
  994.                 -- Stop floating once the token is removed
  995.                 getgenv().temptable.float = false
  996.                 break
  997.             else
  998.                 -- If not a special token, call the farm function
  999.                 farm(v)
  1000.             end
  1001.         end
  1002.     end
  1003. end
  1004.  
  1005.  
  1006. local lastJumpTime = 0
  1007. function avoidmob()
  1008.     local currentTime = tick()
  1009.     if currentTime - lastJumpTime < 1 then return end  -- Avoid spamming jumps, 1 second cooldown
  1010.     lastJumpTime = currentTime
  1011.    
  1012.     for _, v in next, game:GetService("Workspace").Monsters:GetChildren() do
  1013.         if v:FindFirstChild("Head") then
  1014.             if (v.Head.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude < 30
  1015.                 and api.humanoid():GetState() ~= Enum.HumanoidStateType.Freefall then
  1016.                 game.Players.LocalPlayer.Character.Humanoid.Jump = true
  1017.             end
  1018.         end
  1019.     end
  1020. end
  1021.  
  1022. function getcrosshairs(v)
  1023.     -- Check if the object is not the 'Lime green' or 'Flint' color
  1024.     if v.BrickColor ~= BrickColor.new("Lime green") and v.BrickColor ~= BrickColor.new("Flint") then
  1025.         if temptable.crosshair then
  1026.             repeat task.wait() until not temptable.crosshair
  1027.         end
  1028.         temptable.crosshair = true
  1029.        
  1030.         -- Walk to the object
  1031.         api.walkTo(v.Position)
  1032.        
  1033.         -- Continue walking as long as the object is valid and its color is not "Forest green"
  1034.         repeat task.wait() api.walkTo(v.Position) until not v.Parent or v.BrickColor == BrickColor.new("Forest green")
  1035.        
  1036.         -- Cleanup and reset the state
  1037.         task.wait(.1)
  1038.         temptable.crosshair = false
  1039.        
  1040.         -- Remove the object from the crosshairs table if it is no longer valid
  1041.         local index = table.find(temptable.crosshairs, v)
  1042.         if index then
  1043.             table.remove(temptable.crosshairs, index)
  1044.         end
  1045.     else
  1046.         -- If it's "Lime green" or "Flint", remove it directly from the crosshairs table
  1047.         local index = table.find(temptable.crosshairs, v)
  1048.         if index then
  1049.             table.remove(temptable.crosshairs, index)
  1050.         end
  1051.     end
  1052. end
  1053.  
  1054. function makequests()
  1055.     for _, v in next, game:GetService("Workspace").NPCs:GetChildren() do
  1056.         -- Skip specific NPCs
  1057.         if v.Name ~= "Ant Challenge Info" and v.Name ~= "Bubble Bee Man 2" and v.Name ~= "Wind Shrine" and v.Name ~= "Gummy Bear" then
  1058.             if v:FindFirstChild("Platform") and v.Platform:FindFirstChild("AlertPos") then
  1059.                 local alertPos = v.Platform.AlertPos
  1060.                 local alertGui = alertPos:FindFirstChild("AlertGui")
  1061.                 local imageLabel = alertGui and alertGui:FindFirstChild("ImageLabel")
  1062.                
  1063.                 -- Proceed if image label is found and is visible
  1064.                 if imageLabel and imageLabel.ImageTransparency == 0 then
  1065.                     -- Teleport or tween to platform
  1066.                     local platformPosition = v.Platform.Position + Vector3.new(0, 3, 0)
  1067.                     if ZenX.toggles.tptonpc then
  1068.                         game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(platformPosition)
  1069.                         task.wait(1)
  1070.                     else
  1071.                         api.tween(2, CFrame.new(platformPosition))
  1072.                         task.wait(3)
  1073.                     end
  1074.                    
  1075.                     -- Activate the button (first click)
  1076.                     local button = game.Players.LocalPlayer.PlayerGui.ScreenGui.ActivateButton
  1077.                     for _, conn in next, getconnections(button.MouseButton1Click) do
  1078.                         conn.Function()
  1079.                     end
  1080.                     task.wait(8)
  1081.                    
  1082.                     -- Re-check and activate again if still visible
  1083.                     if imageLabel.ImageTransparency == 0 then
  1084.                         for _, conn in next, getconnections(button.MouseButton1Click) do
  1085.                             conn.Function()
  1086.                         end
  1087.                     end
  1088.                    
  1089.                     task.wait(2)
  1090.                 end
  1091.             end
  1092.         end
  1093.     end
  1094. end
  1095.  
  1096. getgenv().Tvk1 = {true, "💖"}
  1097.  
  1098. local function donateToShrine(item, qnt)
  1099.     print(qnt)
  1100.     local s, e = pcall(function()
  1101.         -- Trigger donation event
  1102.         game:GetService("ReplicatedStorage").Events.WindShrineDonation:InvokeServer(item, qnt)
  1103.         wait(0.5)
  1104.        
  1105.         -- Trigger shrine interaction event
  1106.         game.ReplicatedStorage.Events.WindShrineTrigger:FireServer()
  1107.        
  1108.         -- Retrieve shrine platform and teleport player
  1109.         local UsePlatform = game:GetService("Workspace").NPCs["Wind Shrine"]:FindFirstChild("Stage")
  1110.         if UsePlatform then
  1111.             game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame = UsePlatform.CFrame + Vector3.new(0, 5, 0)
  1112.            
  1113.             -- Look for nearby collectibles
  1114.             local startTime = tick()
  1115.             while tick() - startTime < 6 and game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart") do
  1116.                 for _, v in pairs(game.Workspace.Collectibles:GetChildren()) do
  1117.                     if (v.Position - UsePlatform.Position).magnitude < 60 and v.CFrame.YVector.Y == 1 then
  1118.                         game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame = v.CFrame
  1119.                         return -- Exit after collecting the first valid collectible
  1120.                     end
  1121.                 end
  1122.                 wait(0.05) -- Wait briefly before checking again
  1123.             end
  1124.         end
  1125.     end)
  1126.    
  1127.     if not s then
  1128.         print(e) -- Log any errors
  1129.     end
  1130. end
  1131.  
  1132. local function isWindshrineOnCooldown()
  1133.     -- Retrieve the current time and the last cooldown time from StatTools
  1134.     local currentTime = require(game.ReplicatedStorage.OsTime)()  -- Current time
  1135.     local lastCooldownTime = require(game.ReplicatedStorage.StatTools).GetLastCooldownTime(v1, "WindShrine")
  1136.  
  1137.     -- If either the current time or last cooldown time is unavailable, return false
  1138.     if not currentTime or not lastCooldownTime then
  1139.         return false
  1140.     end
  1141.  
  1142.     -- Calculate the cooldown time remaining
  1143.     local cooldown = 3600 - (currentTime - lastCooldownTime)
  1144.  
  1145.     -- Return whether the Wind Shrine is on cooldown
  1146.     return cooldown > 0
  1147. end
  1148.  
  1149. local function canToyBeUsed(toy)
  1150.     local timeleft = getTimeUntilToyAvailable(toy)
  1151.     return timeleft <= 0
  1152. end
  1153.  
  1154. local function canToyBeUsed(toy)
  1155.     local timeleft = getTimeUntilToyAvailable(toy)
  1156.     return timeleft <= 0  -- Return true if the cooldown is complete or negative
  1157. end
  1158.  
  1159. function GetItemListWithValue()
  1160.     local StatCache = require(game.ReplicatedStorage.ClientStatCache)
  1161.     local data = StatCache.Get()
  1162.     return data.Eggs or {}  -- Return an empty table if Eggs is missing
  1163. end
  1164.  
  1165. local function useConvertors()
  1166.     local conv = {"Instant Converter", "Instant Converter B", "Instant Converter C"}
  1167.     local lastWithoutCooldown = nil
  1168.     local converted = false
  1169.  
  1170.     -- Find the first converter that can be used
  1171.     for i, v in pairs(conv) do
  1172.         if canToyBeUsed(v) then
  1173.             lastWithoutCooldown = v
  1174.             break  -- Exit after finding the first available converter
  1175.         end
  1176.     end
  1177.  
  1178.     -- Use the last available converter if possible
  1179.     if lastWithoutCooldown and (string.match(ZenX.vars.autouseMode, "Ticket") or string.match(ZenX.vars.autouseMode, "All")) then
  1180.         if not converted then
  1181.             game:GetService("ReplicatedStorage").Events.ToyEvent:FireServer(lastWithoutCooldown)
  1182.             converted = true
  1183.         end
  1184.     end
  1185.  
  1186.     -- Use Snowflake if available
  1187.     local itemList = GetItemListWithValue()
  1188.     if itemList["Snowflake"] and itemList["Snowflake"] > 0 and (string.match(ZenX.vars.autouseMode, "Snowflak") or string.match(ZenX.vars.autouseMode, "All")) then
  1189.         game:GetService("ReplicatedStorage").Events.PlayerActivesCommand:FireServer({["Name"] = "Snowflake"})
  1190.     end
  1191.  
  1192.     -- Use Coconut if available
  1193.     if itemList["Coconut"] and itemList["Coconut"] > 0 and (string.match(ZenX.vars.autouseMode, "Coconut") or string.match(ZenX.vars.autouseMode, "All")) then
  1194.         game:GetService("ReplicatedStorage").Events.PlayerActivesCommand:FireServer({["Name"] = "Coconut"})
  1195.     end
  1196.  
  1197.     -- Use Stinger if available
  1198.     if itemList["Stinger"] and itemList["Stinger"] > 0 and (string.match(ZenX.vars.autouseMode, "Stinger") or string.match(ZenX.vars.autouseMode, "All")) then
  1199.         game:GetService("ReplicatedStorage").Events.PlayerActivesCommand:FireServer({["Name"] = "Stinger"})
  1200.     end
  1201. end
  1202.  
  1203. local function fetchBuffTable(stats)
  1204.     local stTab = {}
  1205.     local player = game:GetService("Players").LocalPlayer
  1206.     local playerGui = player and player.PlayerGui
  1207.     local screenGui = playerGui and playerGui.ScreenGui
  1208.     if screenGui then
  1209.         local tileGrid = screenGui:FindFirstChild("TileGrid")
  1210.         if tileGrid then
  1211.             -- Iterate through the tiles in TileGrid
  1212.             for _, tile in pairs(tileGrid:GetChildren()) do
  1213.                 local bg = tile:FindFirstChild("BG")
  1214.                 if bg then
  1215.                     local icon = bg:FindFirstChild("Icon")
  1216.                     if icon then
  1217.                         -- Check each stat for matching DecalID
  1218.                         for field, fdata in pairs(stats) do
  1219.                             if fdata["DecalID"] and string.find(icon.Image, fdata["DecalID"]) then
  1220.                                 local text = bg:FindFirstChild("Text")
  1221.                                 if text then
  1222.                                     -- If the Text is empty, assume the buff is at 1
  1223.                                     if text.Text == "" then
  1224.                                         stTab[field] = 1
  1225.                                     else
  1226.                                         -- Extract the number, remove "x" and add 1
  1227.                                         local count = tonumber(string.gsub(text.Text, "x", ""))
  1228.                                         stTab[field] = (count and count + 1) or 1
  1229.                                     end
  1230.                                 end
  1231.                             end
  1232.                         end
  1233.                     end
  1234.                 end
  1235.             end
  1236.         end
  1237.     end
  1238.     return stTab
  1239. end
  1240.  
  1241. local Config = { WindowName = "ZenX v" .. temptable.version .. " Remastered", Color = Color3.fromRGB(164, 84, 255), Keybind = Enum.KeyCode.Semicolon }
  1242. local Window = library:CreateWindow(Config, game:GetService("CoreGui"))
  1243. local hometab = Window:CreateTab("Home")
  1244. local farmtab = Window:CreateTab("Farming")
  1245. local combtab = Window:CreateTab("Combat")
  1246. local itemstab = Window:CreateTab("Items")
  1247. local misctab = Window:CreateTab("Misc")
  1248. local setttab = Window:CreateTab("Settings")
  1249. local loadingInfo = hometab:CreateSection("Startup")
  1250. local loadingFunctions = loadingInfo:CreateLabel("Loading Functions..")
  1251.  
  1252. wait(1)
  1253.  
  1254. loadingFunctions:UpdateText("Loaded Functions")
  1255. local loadingBackend = loadingInfo:CreateLabel("Loading Backend..")
  1256. loadingBackend:UpdateText("Loaded Backend")
  1257. local information = hometab:CreateSection("Information")
  1258. information:CreateLabel("Welcome, " .. api.nickname .. "!")
  1259. information:CreateLabel("Script version: " .. temptable.version)
  1260. information:CreateLabel("Place version: " .. game.PlaceVersion)
  1261. information:CreateLabel(" - Not Safe Function")
  1262. information:CreateLabel("⚙ - Configurable Function")
  1263. information:CreateLabel("📜 - May be exploit specific")
  1264. information:CreateLabel("Place version: " .. game.PlaceVersion)
  1265. information:CreateLabel("Script by Boxking776 and Schervi")
  1266. information:CreateLabel("Originally by weuz_ and mrdevl")
  1267. information:CreateButton("Discord Invite", function() setclipboard("https://discord.gg/pVACsQxAqZ") end)
  1268. information:CreateButton("Donation", function() setclipboard("https://discord.gg/pVACsQxAqZ") end)
  1269.  
  1270. local gainedhoneylabel = information:CreateLabel("Gained Honey: 0")
  1271.  
  1272. information:CreateToggle("Status Panel", true, function(bool)
  1273.     ZenX.toggles.enablestatuspanel = bool
  1274.     local coreGui = game:GetService("CoreGui")
  1275.     for i, v in pairs(coreGui:GetDescendants()) do
  1276.         if string.find(v.Name, "Mob Panel") or string.find(v.Name, "Utility Panel") then
  1277.             v.Visible = bool
  1278.         end
  1279.     end
  1280. end)
  1281.  
  1282. -- Farming Section
  1283. local farmo = farmtab:CreateSection("Farming")
  1284.  
  1285. -- Field Dropdown
  1286. local fielddropdown = farmo:CreateDropdown("Field", fieldstable, function(selectedField)
  1287.     ZenX.vars.field = selectedField
  1288. end)
  1289. fielddropdown:SetOption(fieldstable[1])
  1290.  
  1291. -- Convert At Slider
  1292. convertatslider = farmo:CreateSlider("Convert At", 0, 100, 100, false, function(value)
  1293.     ZenX.vars.convertat = value
  1294. end)
  1295.  
  1296. -- Autofarm Toggle
  1297. local autofarmtoggle = farmo:CreateToggle("Autofarm [⚙]", nil, function(state)
  1298.     ZenX.toggles.autofarm = state
  1299. end)
  1300. autofarmtoggle:CreateKeybind("U", function() end)  -- Placeholder for keybind action
  1301.  
  1302. -- Autodig Toggle
  1303. farmo:CreateToggle("Autodig", nil, function(state)
  1304.     ZenX.toggles.autodig = state
  1305. end)
  1306.  
  1307. -- Autodig Mode Dropdown
  1308. farmo:CreateDropdown("Autodig Mode", {"Normal", "Collector Steal"}, function(selectedMode)
  1309.     ZenX.vars.autodigmode = selectedMode
  1310. end)
  1311.  
  1312. -- Container Tools Section
  1313. local contt = farmtab:CreateSection("Container Tools")
  1314.  
  1315. -- Don't Convert Pollen Toggle
  1316. contt:CreateToggle("Don't Convert Pollen", nil, function(state)
  1317.     ZenX.toggles.disableconversion = state
  1318. end)
  1319.  
  1320. -- Auto Bag Reduction Toggle
  1321. contt:CreateToggle("Auto Bag Reduction", nil, function(state)
  1322.     ZenX.toggles.autouseconvertors = state
  1323. end)
  1324.  
  1325. -- Bag Reduction Mode Dropdown
  1326. contt:CreateDropdown("Bag Reduction Mode", {
  1327.     "Ticket Converters", "Just Snowflakes", "Just Coconuts", "Stingers",
  1328.     "Snowflakes and Coconuts", "Tickets and Snowflakes", "Tickets and Coconuts", "All"
  1329. }, function(selectedMode)
  1330.     ZenX.vars.autouseMode = selectedMode
  1331. end)
  1332.  
  1333. -- Reduction Confirmation Time Slider
  1334. contt:CreateSlider("Reduction Confirmation Time", 3, 20, 10, false, function(value)
  1335.     ZenX.vars.autoconvertWaitTime = tonumber(value)
  1336. end)
  1337.  
  1338. -- Additional Farming Options
  1339. farmo:CreateToggle("Auto Sprinkler", nil, function(state)
  1340.     ZenX.toggles.autosprinkler = state
  1341. end)
  1342.  
  1343. farmo:CreateToggle("Farm Bubbles", nil, function(state)
  1344.     ZenX.toggles.farmbubbles = state
  1345. end)
  1346.  
  1347. farmo:CreateToggle("Farm Flames", nil, function(state)
  1348.     ZenX.toggles.farmflame = state
  1349. end)
  1350.  
  1351. farmo:CreateToggle("Farm Coconuts & Shower", nil, function(state)
  1352.     ZenX.toggles.farmcoco = state
  1353. end)
  1354.  
  1355. farmo:CreateToggle("Farm Precise Crosshairs", nil, function(state)
  1356.     ZenX.toggles.collectcrosshairs = state
  1357. end)
  1358.  
  1359. farmo:CreateToggle("Farm Fuzzy Bombs", nil, function(state)
  1360.     ZenX.toggles.farmfuzzy = state
  1361. end)
  1362.  
  1363. farmo:CreateToggle("Farm Under Balloons", nil, function(state)
  1364.     ZenX.toggles.farmunderballoons = state
  1365. end)
  1366.  
  1367. farmo:CreateToggle("Farm Under Clouds", nil, function(state)
  1368.     ZenX.toggles.farmclouds = state
  1369. end)
  1370.  
  1371. farmo:CreateToggle("Farm Duped Tokens", nil, function(state)
  1372.     ZenX.toggles.farmduped = state
  1373. end)
  1374.  
  1375. farmo:CreateToggle("Auto Honey Mask", nil, function(bool)
  1376.     ZenX.toggles.honeymaskconv = bool
  1377. end)
  1378.  
  1379. farmo:CreateDropdown("Default Mask", MasksTable, function(val)
  1380.     ZenX.vars.defmask = val
  1381. end)
  1382.  
  1383.  
  1384. -- Farming Tools
  1385. local farmt = farmtab:CreateSection("Farming")
  1386.  
  1387. -- Automation Toggles
  1388. farmt:CreateToggle("Auto Dispenser [⚙]", nil, function(state)
  1389.     ZenX.toggles.autodispense = state
  1390. end)
  1391.  
  1392. farmt:CreateToggle("Auto Field Boosters [⚙]", nil, function(state)
  1393.     ZenX.toggles.autoboosters = state
  1394. end)
  1395.  
  1396. farmt:CreateToggle("Auto Wealth Clock", nil, function(state)
  1397.     ZenX.toggles.clock = state
  1398. end)
  1399.  
  1400. farmt:CreateToggle("Auto Gingerbread Bears [B]", nil, function(state)
  1401.     ZenX.toggles.collectgingerbreads = state
  1402. end)
  1403.  
  1404. farmt:CreateToggle("Auto Samovar [B]", nil, function(state)
  1405.     ZenX.toggles.autosamovar = state
  1406. end)
  1407.  
  1408. farmt:CreateToggle("Auto Snow Machine [B]", nil, function(state)
  1409.     ZenX.toggles.autosnowmachines = state
  1410. end)
  1411.  
  1412. farmt:CreateToggle("Auto Stockings [B]", nil, function(state)
  1413.     ZenX.toggles.autostockings = state
  1414. end)
  1415.  
  1416. farmt:CreateToggle("Auto Honey Wreath [B]", nil, function(state)
  1417.     ZenX.toggles.autowreath = state
  1418. end)
  1419.  
  1420. farmt:CreateToggle("Auto Planters", nil, function(state)
  1421.     ZenX.toggles.autoplanters = state
  1422. end):AddToolTip("Will re-plant your planters after converting, if they hit 100%")
  1423.  
  1424. farmt:CreateToggle("Auto Honey Candles [B]", nil, function(state)
  1425.     ZenX.toggles.autocandles = state
  1426. end)
  1427.  
  1428. farmt:CreateToggle("Auto Beesmas Feast [B]", nil, function(state)
  1429.     ZenX.toggles.autofeast = state
  1430. end)
  1431.  
  1432. farmt:CreateToggle("Auto Onett's Lid Art [B]", nil, function(state)
  1433.     ZenX.toggles.autoonettart = state
  1434. end)
  1435.  
  1436. farmt:CreateToggle("Auto Free Antpasses", nil, function(state)
  1437.     ZenX.toggles.freeantpass = state
  1438. end)
  1439.  
  1440. -- Farming Toggles
  1441. farmt:CreateToggle("Farm Sprouts", nil, function(state)
  1442.     ZenX.toggles.farmsprouts = state
  1443. end)
  1444.  
  1445. farmt:CreateToggle("Farm Puffshrooms", nil, function(state)
  1446.     ZenX.toggles.farmpuffshrooms = state
  1447. end)
  1448.  
  1449. farmt:CreateToggle("Farm Snowflakes [🛡️] [B]", nil, function(state)
  1450.     ZenX.toggles.farmsnowflakes = state
  1451. end)
  1452.  
  1453. farmt:CreateToggle("Teleport To Rares [⚠️]", nil, function(state)
  1454.     ZenX.toggles.farmrares = state
  1455. end)
  1456.  
  1457. -- Quest Toggles
  1458. farmt:CreateToggle("Auto Accept/Confirm Quests [⚙]", nil, function(state)
  1459.     ZenX.toggles.autoquest = state
  1460. end)
  1461.  
  1462. farmt:CreateToggle("Auto Do Quests [⚙]", nil, function(state)
  1463.     ZenX.toggles.autodoquest = state
  1464. end)
  1465.  
  1466. -- Miscellaneous Farming
  1467. farmt:CreateToggle("Auto Honeystorm", nil, function(state)
  1468.     ZenX.toggles.honeystorm = state
  1469. end)
  1470.  
  1471. farmt:CreateToggle("Reset Bee Energy after X Conversions", nil, function(bool)
  1472.     ZenX.vars.resetbeeenergy = bool
  1473. end)
  1474.  
  1475. farmt:CreateTextBox("Conversion Amount", "default = 3", true, function(value)
  1476.     ZenX.vars.resettimer = tonumber(value)
  1477. end)
  1478.  
  1479. -- Combat Section
  1480. local mobkill = combtab:CreateSection("Combat")
  1481.  
  1482. mobkill:CreateToggle("Train Crab", nil, function(state)
  1483.     if state then
  1484.         local humanoidRootPart = api.humanoidrootpart()
  1485.         if humanoidRootPart then
  1486.             humanoidRootPart.CFrame = CFrame.new(-307.521, 107.919, 467.868)
  1487.         else
  1488.             warn("HumanoidRootPart not found!")
  1489.         end
  1490.     end
  1491. end)
  1492.  
  1493. mobkill:CreateToggle("Train Snail", nil, function(state)
  1494.     local stumpField = game.Workspace.FlowerZones:FindFirstChild("Stump Field")
  1495.     if stumpField then
  1496.         local position = stumpField.Position
  1497.         local humanoidRootPart = api.humanoidrootpart()
  1498.        
  1499.         if humanoidRootPart then
  1500.             if state then
  1501.                 humanoidRootPart.CFrame = CFrame.new(position.X, position.Y - 6, position.Z)
  1502.             else
  1503.                 humanoidRootPart.CFrame = CFrame.new(position.X, position.Y + 2, position.Z)
  1504.             end
  1505.         else
  1506.             warn("HumanoidRootPart not found!")
  1507.         end
  1508.     else
  1509.         warn("'Stump Field' not found in FlowerZones!")
  1510.     end
  1511. end)
  1512.  
  1513. -- Misc Section
  1514. local misc = mistab:CreateSection("Misc")
  1515. misc:CreateToggle("FPS Display", true, function(state)
  1516.     local coreGui = game:GetService("CoreGui")
  1517.     local fpsDisplayFound = false
  1518.  
  1519.     for _, descendant in ipairs(coreGui:GetDescendants()) do
  1520.         if string.find(descendant.Name, "FPS") then
  1521.             descendant.Visible = state
  1522.             fpsDisplayFound = true
  1523.         end
  1524.     end
  1525.  
  1526.     if not fpsDisplayFound then
  1527.         warn("No FPS display elements found in CoreGui!")
  1528.     end
  1529. end)
  1530.  
  1531. -- Autofeed Section
  1532. autofeed:CreateDropdown("Select Treat", treatsTable, function(option)
  1533.     ZenX.vars.selectedTreat = option
  1534. end)
  1535.  
  1536. autofeed:CreateTextBox("Treat Amount", "10", false, function(value)
  1537.     local amount = tonumber(value)
  1538.     if amount and amount > 0 then
  1539.         ZenX.vars.selectedTreatAmount = amount
  1540.     else
  1541.         warn("Invalid treat amount. Please enter a positive number.")
  1542.     end
  1543. end)
  1544.  
  1545. autofeed:CreateButton("Feed All Bees", function()
  1546.     if ZenX.vars.selectedTreat and ZenX.vars.selectedTreatAmount then
  1547.         feedAllBees(ZenX.vars.selectedTreat, ZenX.vars.selectedTreatAmount)
  1548.     else
  1549.         warn("Please select a treat and specify a valid amount before feeding.")
  1550.     end
  1551. end)
  1552.  
  1553. -- Wind Shrine Section
  1554. local windShrine = itemstab:CreateSection("Wind Shrine")
  1555.  
  1556. windShrine:CreateDropdown("Select Item", donatableItemsTable, function(option)
  1557.     ZenX.vars.donoItem = option
  1558. end)
  1559.  
  1560. windShrine:CreateTextBox("Item Quantity", "10", false, function(value)
  1561.     local amount = tonumber(value)
  1562.     if amount and amount > 0 then
  1563.         ZenX.vars.donoAmount = amount
  1564.     else
  1565.         warn("Invalid quantity. Please enter a positive number.")
  1566.     end
  1567. end)
  1568.  
  1569. windShrine:CreateButton("Donate", function()
  1570.     if ZenX.vars.donoItem and ZenX.vars.donoAmount then
  1571.         donateToShrine(ZenX.vars.donoItem, ZenX.vars.donoAmount)
  1572.         print("Donated " .. ZenX.vars.donoAmount .. " of " .. ZenX.vars.donoItem)
  1573.     else
  1574.         warn("Please select an item and specify a valid quantity before donating.")
  1575.     end
  1576. end)
  1577.  
  1578. windShrine:CreateToggle("Auto Donate", nil, function(state)
  1579.     ZenX.toggles.autodonate = state
  1580.     if state then
  1581.         print("Auto Donate enabled.")
  1582.     else
  1583.         print("Auto Donate disabled.")
  1584.     end
  1585. end)
  1586.  
  1587. -- Autofarm Settings Section
  1588. local farmsettings = setttab:CreateSection("Autofarm Settings")
  1589.  
  1590. -- TextBox for Autofarming Walkspeed
  1591. farmsettings:CreateTextBox("Autofarming Walkspeed", "Default Value = 60", true, function(value)
  1592.     local speed = tonumber(value)
  1593.     if speed and speed > 0 then
  1594.         ZenX.vars.farmspeed = speed
  1595.         print("Autofarming Walkspeed set to: " .. speed)
  1596.     else
  1597.         warn("Invalid value. Please enter a positive number.")
  1598.     end
  1599. end)
  1600.  
  1601. -- Toggle for Loop Speed On Autofarming
  1602. farmsettings:CreateToggle("^ Loop Speed On Autofarming", nil, function(state)
  1603.     ZenX.toggles.loopfarmspeed = state
  1604.     print("Loop Speed On Autofarming is now: " .. (state and "Enabled" or "Disabled"))
  1605. end)
  1606.  
  1607. -- Toggle for Not Walking in the Field
  1608. farmsettings:CreateToggle("Don't Walk In Field", nil, function(state)
  1609.     ZenX.toggles.farmflower = state
  1610.     print("Don't Walk In Field is now: " .. (state and "Enabled" or "Disabled"))
  1611. end)
  1612.  
  1613. -- Toggle for Converting Hive Balloon
  1614. farmsettings:CreateToggle("Convert Hive Balloon", nil, function(state)
  1615.     ZenX.toggles.convertballoons = state
  1616.     print("Convert Hive Balloon is now: " .. (state and "Enabled" or "Disabled"))
  1617. end)
  1618.  
  1619. -- Toggle for Not Farming Tokens
  1620. farmsettings:CreateToggle("Don't Farm Tokens", nil, function(state)
  1621.     ZenX.toggles.donotfarmtokens = state
  1622.     print("Don't Farm Tokens is now: " .. (state and "Enabled" or "Disabled"))
  1623. end)
  1624.  
  1625. -- Toggle for Enabling Token Blacklisting
  1626. farmsettings:CreateToggle("Enable Token Blacklisting", nil, function(state)
  1627.     ZenX.toggles.enabletokenblacklisting = state
  1628.     print("Token Blacklisting is now: " .. (state and "Enabled" or "Disabled"))
  1629. end)
  1630.  
  1631. -- Slider for Walk Speed
  1632. farmsettings:CreateSlider("Walk Speed", 0, 120, 70, false, function(value)
  1633.     if value >= 0 and value <= 120 then
  1634.         ZenX.vars.walkspeed = value
  1635.         print("Walk Speed set to: " .. value)
  1636.     else
  1637.         warn("Walk Speed value out of range (0-120).")
  1638.     end
  1639. end)
  1640.  
  1641. -- Slider for Jump Power
  1642. farmsettings:CreateSlider("Jump Power", 0, 120, 70, false, function(value)
  1643.     if value >= 0 and value <= 120 then
  1644.         ZenX.vars.jumppower = value
  1645.         print("Jump Power set to: " .. value)
  1646.     else
  1647.         warn("Jump Power value out of range (0-120).")
  1648.     end
  1649. end)
  1650.  
  1651. -- Tokens Settings Section
  1652. local raresettings = setttab:CreateSection("Tokens Settings")
  1653.  
  1654. -- TextBox to Enter Asset ID
  1655. raresettings:CreateTextBox("Asset ID", "Enter rbxassetid", false, function(value)
  1656.     rarename = value
  1657.     print("Asset ID set to: " .. rarename)
  1658. end)
  1659.  
  1660. -- Button to Add Token to Rares List
  1661. raresettings:CreateButton("Add Token To Rares List", function()
  1662.     if rarename then
  1663.         table.insert(ZenX.rares, rarename)
  1664.         print("Token added to Rares List: " .. rarename)
  1665.         updateDropdown("Rares List", ZenX.rares, raresettings)
  1666.     else
  1667.         warn("No Asset ID provided to add.")
  1668.     end
  1669. end)
  1670.  
  1671. -- Button to Remove Token from Rares List
  1672. raresettings:CreateButton("Remove Token From Rares List", function()
  1673.     if rarename and api.tablefind(ZenX.rares, rarename) then
  1674.         table.remove(ZenX.rares, api.tablefind(ZenX.rares, rarename))
  1675.         print("Token removed from Rares List: " .. rarename)
  1676.         updateDropdown("Rares List", ZenX.rares, raresettings)
  1677.     else
  1678.         warn("Token not found in Rares List.")
  1679.     end
  1680. end)
  1681.  
  1682. -- Button to Add Token to Blacklist
  1683. raresettings:CreateButton("Add Token To Blacklist", function()
  1684.     if rarename then
  1685.         table.insert(ZenX.bltokens, rarename)
  1686.         print("Token added to Blacklist: " .. rarename)
  1687.         updateDropdown("Tokens Blacklist", ZenX.bltokens, raresettings)
  1688.     else
  1689.         warn("No Asset ID provided to add.")
  1690.     end
  1691. end)
  1692.  
  1693. -- Button to Remove Token from Blacklist
  1694. raresettings:CreateButton("Remove Token From Blacklist", function()
  1695.     if rarename and api.tablefind(ZenX.bltokens, rarename) then
  1696.         table.remove(ZenX.bltokens, api.tablefind(ZenX.bltokens, rarename))
  1697.         print("Token removed from Blacklist: " .. rarename)
  1698.         updateDropdown("Tokens Blacklist", ZenX.bltokens, raresettings)
  1699.     else
  1700.         warn("Token not found in Blacklist.")
  1701.     end
  1702. end)
  1703.  
  1704. -- Dropdowns for Tokens Blacklist and Rares List
  1705. raresettings:CreateDropdown("Tokens Blacklist", ZenX.bltokens, function(option)
  1706.     print("Selected from Blacklist: " .. option)
  1707. end)
  1708. raresettings:CreateDropdown("Rares List", ZenX.rares, function(option)
  1709.     print("Selected from Rares List: " .. option)
  1710. end)
  1711.  
  1712. -- Auto Dispenser & Boosters Settings Section
  1713. local dispsettings = setttab:CreateSection("Auto Dispenser & Auto Boosters Settings")
  1714.  
  1715. -- Function to Create Toggles for Dispensers and Boosters
  1716. local function createDispenserToggle(name, key)
  1717.     dispsettings:CreateToggle(name, nil, function(state)
  1718.         ZenX.dispensesettings[key] = state
  1719.         print(name .. " is now: " .. (state and "Enabled" or "Disabled"))
  1720.     end)
  1721. end
  1722.  
  1723. -- Creating Toggles
  1724. createDispenserToggle("Royal Jelly Dispenser", "rj")
  1725. createDispenserToggle("Blueberry Dispenser", "blub")
  1726. createDispenserToggle("Strawberry Dispenser", "straw")
  1727. createDispenserToggle("Treat Dispenser", "treat")
  1728. createDispenserToggle("Coconut Dispenser", "coconut")
  1729. createDispenserToggle("Glue Dispenser", "glue")
  1730. createDispenserToggle("Mountain Top Booster", "white")
  1731. createDispenserToggle("Blue Field Booster", "blue")
  1732. createDispenserToggle("Red Field Booster", "red")
  1733.  
  1734. -- Helper Function: Update Dropdowns Dynamically
  1735. function updateDropdown(dropdownName, itemList, section)
  1736.     local gui = game:GetService("CoreGui"):FindFirstChild(_G.windowname)
  1737.     if gui and gui.Main:FindFirstChild(dropdownName .. " D", true) then
  1738.         gui.Main:FindFirstChild(dropdownName .. " D", true):Destroy()
  1739.     end
  1740.     section:CreateDropdown(dropdownName, itemList, function(option)
  1741.         print("Selected from " .. dropdownName .. ": " .. option)
  1742.     end)
  1743. end
  1744.  
  1745. -- GUI Settings Section
  1746. local guisettings = setttab:CreateSection("GUI Settings")
  1747.  
  1748. -- Toggle for UI Visibility
  1749. local uitoggle = guisettings:CreateToggle("UI Toggle", nil, function(state)
  1750.     Window:Toggle(state)
  1751.     print("UI Toggle is now: " .. (state and "Enabled" or "Disabled"))
  1752. end)
  1753.  
  1754. -- Keybind for UI Toggle
  1755. uitoggle:CreateKeybind(tostring(Config.Keybind):gsub("Enum.KeyCode.", ""), function(key)
  1756.     Config.Keybind = Enum.KeyCode[key]
  1757.     print("UI Keybind updated to: " .. key)
  1758. end)
  1759.  
  1760. -- Default State for UI Toggle
  1761. uitoggle:SetState(true)
  1762.  
  1763. -- Color Picker for UI Theme
  1764. guisettings:CreateColorpicker("UI Color", function(color)
  1765.     Window:ChangeColor(color)
  1766.     print("UI Color changed to: " .. tostring(color))
  1767. end)
  1768.  
  1769. -- Themes Dropdown for GUI Background
  1770. local themes = guisettings:CreateDropdown("Image",
  1771.     {"Default", "Hearts", "Abstract", "Hexagon", "Circles", "Lace With Flowers", "Floral"},
  1772.     function(Name)
  1773.         -- Background Asset IDs for each theme
  1774.         local backgroundIDs = {
  1775.             Default = "2151741365",
  1776.             Hearts = "6073763717",
  1777.             Abstract = "6073743871",
  1778.             Hexagon = "6073628839",
  1779.             Circles = "6071579801",
  1780.             ["Lace With Flowers"] = "6071575925",
  1781.             Floral = "5553946656"
  1782.         }
  1783.        
  1784.         -- Update background based on selected theme
  1785.         local backgroundID = backgroundIDs[Name]
  1786.         if backgroundID then
  1787.             Window:SetBackground(backgroundID)
  1788.             print("Background changed to: " .. Name .. " (ID: " .. backgroundID .. ")")
  1789.         else
  1790.             warn("Invalid theme selected: " .. tostring(Name))
  1791.         end
  1792.     end
  1793. )
  1794.  
  1795. -- Set default option to "Default"
  1796. themes:SetOption("Default")
  1797.  
  1798. -- Configs Section
  1799. local ZenXs = setttab:CreateSection("Configs")
  1800.  
  1801. -- Create a text box to input the config name
  1802. ZenXs:CreateTextBox("Config Name", 'ex: stumpconfig', false, function(Value)
  1803.     temptable.configname = Value
  1804. end)
  1805.  
  1806. -- Load the config when the button is clicked
  1807. ZenXs:CreateButton("Load Config", function()
  1808.     -- Ensure the config file exists before attempting to load
  1809.     local configFile = "ZenX/BSS_"..temptable.configname..".json"
  1810.     if isfile(configFile) then
  1811.         local configData = game:service'HttpService':JSONDecode(readfile(configFile))
  1812.         ZenX = configData
  1813.         print("Config loaded successfully.")
  1814.     else
  1815.         warn("Config file not found: " .. configFile)
  1816.     end
  1817. end)
  1818.  
  1819. -- Save the current config to a file
  1820. ZenXs:CreateButton("Save Config", function()
  1821.     local configFile = "ZenX/BSS_"..temptable.configname..".json"
  1822.     local encodedConfig = game:service'HttpService':JSONEncode(ZenX)
  1823.     -- Check if the config name is valid
  1824.     if not temptable.configname or temptable.configname == "" then
  1825.         warn("Please enter a valid config name.")
  1826.     else
  1827.         writefile(configFile, encodedConfig)
  1828.         print("Config saved as: " .. configFile)
  1829.     end
  1830. end)
  1831.  
  1832. -- Reset to default config
  1833. ZenXs:CreateButton("Reset Config", function()
  1834.     ZenX = defaultZenX
  1835.     print("Config has been reset to default.")
  1836. end)
  1837.  
  1838. -- Fields Settings Section
  1839. local fieldsettings = setttab:CreateSection("Fields Settings")
  1840.  
  1841. -- Best White Field Dropdown
  1842. fieldsettings:CreateDropdown("Best White Field", temptable.whitefields, function(Option)
  1843.     if Option then
  1844.         ZenX.bestfields.white = Option
  1845.         print("Best White Field set to: " .. Option)
  1846.     else
  1847.         warn("No option selected for Best White Field.")
  1848.     end
  1849. end)
  1850.  
  1851. -- Best Red Field Dropdown
  1852. fieldsettings:CreateDropdown("Best Red Field", temptable.redfields, function(Option)
  1853.     if Option then
  1854.         ZenX.bestfields.red = Option
  1855.         print("Best Red Field set to: " .. Option)
  1856.     else
  1857.         warn("No option selected for Best Red Field.")
  1858.     end
  1859. end)
  1860.  
  1861. -- Best Blue Field Dropdown
  1862. fieldsettings:CreateDropdown("Best Blue Field", temptable.bluefields, function(Option)
  1863.     if Option then
  1864.         ZenX.bestfields.blue = Option
  1865.         print("Best Blue Field set to: " .. Option)
  1866.     else
  1867.         warn("No option selected for Best Blue Field.")
  1868.     end
  1869. end)
  1870.  
  1871. -- Vicious Bee Killer
  1872. task.spawn(function()
  1873.     while task.wait(1) do
  1874.         if ZenX.toggles.killvicious and temptable.detected.vicious and not temptable.converting and not temptable.started.monsters then
  1875.             temptable.started.vicious = true
  1876.             disableall()
  1877.  
  1878.             local vichumanoid = game:GetService("Players").LocalPlayer.Character.HumanoidRootPart
  1879.             local particles = game.workspace.Particles:GetChildren()
  1880.  
  1881.             -- Find Vicious particles and perform animation
  1882.             local viciousParticles = {}
  1883.             for _, particle in ipairs(particles) do
  1884.                 if string.find(particle.Name, "Vicious") then
  1885.                     table.insert(viciousParticles, particle)
  1886.                 end
  1887.             end
  1888.  
  1889.             -- Particle animation loop
  1890.             for _, particle in ipairs(viciousParticles) do
  1891.                 api.tween(1, CFrame.new(particle.Position))
  1892.                 task.wait(1)
  1893.                 api.tween(0.5, CFrame.new(particle.Position))
  1894.                 task.wait(0.5)
  1895.             end
  1896.  
  1897.             -- Killing vicious loop
  1898.             while ZenX.toggles.killvicious and temptable.detected.vicious do
  1899.                 for _, particle in ipairs(viciousParticles) do
  1900.                     vichumanoid.CFrame = CFrame.new(particle.Position + Vector3.new(10, 0, 0))
  1901.                     temptable.float = true
  1902.                     task.wait(0.3)
  1903.                 end
  1904.             end
  1905.  
  1906.             -- Re-enable all functions after killing
  1907.             enableall()
  1908.             task.wait(1)
  1909.             temptable.float = false
  1910.             temptable.started.vicious = false
  1911.         end
  1912.     end
  1913. end)
  1914.  
  1915. -- Windy Bee Handler
  1916. task.spawn(function()
  1917.     while task.wait(1) do
  1918.         if ZenX.toggles.killwindy and temptable.detected.windy and not temptable.converting and not temptable.started.vicious and not temptable.started.mondo and not temptable.started.monsters then
  1919.             temptable.started.windy = true
  1920.             local wlvl = ""
  1921.             local hasMonster, isAtWindyBee = false, false
  1922.  
  1923.             disableall()
  1924.  
  1925.             -- Main loop for killing Windy bee
  1926.             while ZenX.toggles.killwindy and temptable.detected.windy do
  1927.                 -- Detect first Windy monster
  1928.                 if not hasMonster then
  1929.                     for _, monster in ipairs(workspace.Monsters:GetChildren()) do
  1930.                         if string.find(monster.Name, "Windy") then
  1931.                             wlvl = monster.Name
  1932.                             hasMonster = true
  1933.                             break
  1934.                         end
  1935.                     end
  1936.                 end
  1937.  
  1938.                 -- Handle additional Windy monsters
  1939.                 if hasMonster then
  1940.                     for _, monster in ipairs(workspace.Monsters:GetChildren()) do
  1941.                         if string.find(monster.Name, "Windy") and monster.Name ~= wlvl then
  1942.                             temptable.float = false
  1943.                             task.wait(5)
  1944.                             -- Collect tokens around the player
  1945.                             for _ = 1, 5 do
  1946.                                 gettoken(api.humanoidrootpart().Position)
  1947.                             end
  1948.                             wlvl = monster.Name
  1949.                         end
  1950.                     end
  1951.                 end
  1952.  
  1953.                 -- Tween to Windy bee's position if not done already
  1954.                 if not isAtWindyBee then
  1955.                     api.tween(1, temptable.gacf(temptable.windy, 5))
  1956.                     task.wait(1)
  1957.                     isAtWindyBee = true
  1958.                 end
  1959.  
  1960.                 -- Move to the Windy bee and start floating
  1961.                 if isAtWindyBee and temptable.windy.Name == "Windy" then
  1962.                     api.humanoidrootpart().CFrame = temptable.gacf(temptable.windy, 25)
  1963.                     temptable.float = true
  1964.                     task.wait()
  1965.                 end
  1966.             end
  1967.  
  1968.             -- Re-enable everything after Windy bee is dealt with
  1969.             enableall()
  1970.             temptable.float = false
  1971.             temptable.started.windy = false
  1972.         end
  1973.     end
  1974. end)
  1975.  
  1976. -- Collector Steal
  1977. local function collectorSteal()
  1978.     if ZenX.vars.autodigmode == "Collector Steal" then
  1979.         -- Loop through all players in the game
  1980.         for _, player in ipairs(game.Players:GetChildren()) do
  1981.             -- Make sure we're not interacting with the local player and that the player has a character
  1982.             if player.Name ~= game.Players.LocalPlayer.Name and player.Character then
  1983.                 -- Find the first tool the player is holding
  1984.                 local tool = player.Character:FindFirstChildWhichIsA("Tool")
  1985.                 -- If the tool exists and has a ClickEvent, fire the event
  1986.                 if tool and tool:FindFirstChild("ClickEvent") then
  1987.                     tool.ClickEvent:FireServer()
  1988.                 end
  1989.             end
  1990.         end
  1991.     end
  1992. end
  1993.  
  1994. -- Farm Rares and Auto-Dig
  1995. task.spawn(function()
  1996.     while task.wait(0.05) do
  1997.         -- Farm Rares Logic
  1998.         if ZenX.toggles.farmrares then
  1999.             for _, collectible in ipairs(game.workspace.Collectibles:GetChildren()) do
  2000.                 -- Ensure collectible is visible and not transparent
  2001.                 if collectible.CFrame.YVector.Y == 1 and collectible.Transparency == 0 then
  2002.                     local decal = collectible:FindFirstChildOfClass("Decal")
  2003.                     if decal then
  2004.                         -- Check if the decal matches any rare item in the list
  2005.                         for _, rare in ipairs(ZenX.rares) do
  2006.                             if decal.Texture == rare or decal.Texture == "rbxassetid://" .. rare then
  2007.                                 -- Teleport to collectible and collect it
  2008.                                 game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = collectible.CFrame
  2009.                                 break
  2010.                             end
  2011.                         end
  2012.                     end
  2013.                 end
  2014.             end
  2015.         end
  2016.        
  2017.         -- Auto-Dig Logic
  2018.         if ZenX.toggles.autodig then
  2019.             pcall(function()
  2020.                 local player = game.Players.LocalPlayer
  2021.                 if player and player.Character then
  2022.                     local tool = player.Character:FindFirstChildOfClass("Tool")
  2023.                     -- Ensure the player is holding a tool with a ClickEvent
  2024.                     if tool and tool:FindFirstChild("ClickEvent", true) then
  2025.                         -- Trigger the collection event with the player's mouse
  2026.                         getsenv(tool.ClientScriptMouse).collectStart(player:GetMouse())
  2027.                     end
  2028.                     -- Call the collectorSteal function to collect items from other players
  2029.                     collectorSteal()
  2030.                     -- Trigger the Porcelain Dipper NPC's ClickEvent
  2031.                     workspace.NPCs.Onett.Onett["Porcelain Dipper"].ClickEvent:FireServer()
  2032.                 end
  2033.             end)
  2034.         end
  2035.     end
  2036. end)
  2037.  
  2038. -- Event Handlers for Sprouts and NPCs
  2039.  
  2040. -- Handle Sprout Addition
  2041. game:GetService("Workspace").Particles.Folder2.ChildAdded:Connect(function(child)
  2042.     if child.Name == "Sprout" then
  2043.         temptable.sprouts.detected = true
  2044.         temptable.sprouts.coords = child.CFrame
  2045.     end
  2046. end)
  2047.  
  2048. -- Handle Sprout Removal
  2049. game:GetService("Workspace").Particles.Folder2.ChildRemoved:Connect(function(child)
  2050.     if child.Name == "Sprout" then
  2051.         task.wait(30)  -- Allow some time for potential re-addition
  2052.         temptable.sprouts.detected = false
  2053.         temptable.sprouts.coords = nil  -- Clear coordinates
  2054.     end
  2055. end)
  2056.  
  2057. -- Handle Vicious Bee Addition
  2058. Workspace.Particles.ChildAdded:Connect(function(instance)
  2059.     if string.find(instance.Name, "Vicious") then
  2060.         temptable.detected.vicious = true
  2061.     end
  2062. end)
  2063.  
  2064. -- Handle Vicious Bee Removal
  2065. Workspace.Particles.ChildRemoved:Connect(function(instance)
  2066.     if string.find(instance.Name, "Vicious") then
  2067.         temptable.detected.vicious = false
  2068.     end
  2069. end)
  2070.  
  2071. -- Handle Windy Bee Addition
  2072. game:GetService("Workspace").NPCBees.ChildAdded:Connect(function(npc)
  2073.     if npc.Name == "Windy" then
  2074.         task.wait(3)  -- Wait for NPC to fully load
  2075.         temptable.windy = npc
  2076.         temptable.detected.windy = true
  2077.     end
  2078. end)
  2079.  
  2080. -- Handle Windy Bee Removal
  2081. game:GetService("Workspace").NPCBees.ChildRemoved:Connect(function(npc)
  2082.     if npc.Name == "Windy" then
  2083.         task.wait(3)  -- Wait to ensure NPC removal is processed
  2084.         temptable.windy = nil
  2085.         temptable.detected.windy = false
  2086.     end
  2087. end)
  2088.  
  2089. -- Auto Toy Usage and Donation
  2090. task.spawn(function()
  2091.     while task.wait(1) do
  2092.         if not temptable.converting then
  2093.             -- Define toys and their associated platforms
  2094.             local toys = {
  2095.                 ["Samovar"] = game:GetService("Workspace").Toys.Samovar.Platform,
  2096.                 ["Snow Machine"] = nil,
  2097.                 ["Stockings"] = game:GetService("Workspace").Toys.Stockings.Platform,
  2098.                 ["Honey Wreath"] = game:GetService("Workspace").Toys["Honey Wreath"].Platform,
  2099.                 ["Onett's Lid Art"] = game:GetService("Workspace").Toys["Onett's Lid Art"].Platform,
  2100.                 ["Honeyday Candles"] = game:GetService("Workspace").Toys["Honeyday Candles"].Platform,
  2101.                 ["Beesmas Feast"] = game:GetService("Workspace").Toys["Beesmas Feast"].Platform
  2102.             }
  2103.  
  2104.             -- Iterate through the toys and use them if toggled
  2105.             for toy, platform in pairs(toys) do
  2106.                 if ZenX.toggles["auto" .. toy:lower():gsub(" ", "")] then
  2107.                     -- Fire event to use the toy
  2108.                     game:GetService("ReplicatedStorage").Events.ToyEvent:FireServer(toy)
  2109.  
  2110.                     -- If there's a platform associated with the toy, move towards collectibles nearby
  2111.                     if platform then
  2112.                         for _, collectible in ipairs(game.Workspace.Collectibles:GetChildren()) do
  2113.                             -- Check if the collectible is close to the platform and its transparency is 0 (visible)
  2114.                             if (collectible.Position - platform.Position).magnitude < 25 and collectible.CFrame.YVector.Y == 1 then
  2115.                                 api.humanoidrootpart().CFrame = collectible.CFrame
  2116.                             end
  2117.                         end
  2118.                     end
  2119.                 end
  2120.             end
  2121.  
  2122.             -- Auto donation check
  2123.             if ZenX.toggles.autodonate and not isWindshrineOnCooldown() then
  2124.                 donateToShrine(ZenX.vars.donoItem, ZenX.vars.donoAmount)
  2125.             end
  2126.         end
  2127.     end
  2128. end)
  2129.  
  2130. -- Main Task Loop
  2131. task.spawn(function()
  2132.     while task.wait(1) do
  2133.         -- Track runtime and update honey count
  2134.         temptable.runningfor = temptable.runningfor + 1
  2135.         temptable.honeycurrent = statsget().Totals.Honey
  2136.        
  2137.         -- Honeystorm (trigger event)
  2138.         if ZenX.toggles.honeystorm then
  2139.             game.ReplicatedStorage.Events.ToyEvent:FireServer("Honeystorm")
  2140.         end
  2141.        
  2142.         -- Collect Gingerbreads (trigger event)
  2143.         if ZenX.toggles.collectgingerbreads then
  2144.             game:GetService("ReplicatedStorage").Events.ToyEvent:FireServer("Gingerbread House")
  2145.         end
  2146.        
  2147.         -- Auto Dispensers
  2148.         if ZenX.toggles.autodispense then
  2149.             local dispensers = {
  2150.                 ["rj"] = "Free Royal Jelly Dispenser",
  2151.                 ["blub"] = "Blueberry Dispenser",
  2152.                 ["straw"] = "Strawberry Dispenser",
  2153.                 ["treat"] = "Treat Dispenser",
  2154.                 ["coconut"] = "Coconut Dispenser",
  2155.                 ["glue"] = "Glue Dispenser"
  2156.             }
  2157.             for key, dispenser in pairs(dispensers) do
  2158.                 if ZenX.dispensesettings[key] then
  2159.                     game:GetService("ReplicatedStorage").Events.ToyEvent:FireServer(dispenser)
  2160.                 end
  2161.             end
  2162.         end
  2163.        
  2164.         -- Auto Boosters
  2165.         if ZenX.toggles.autoboosters then
  2166.             local boosters = {
  2167.                 ["white"] = "Field Booster",
  2168.                 ["red"] = "Red Field Booster",
  2169.                 ["blue"] = "Blue Field Booster"
  2170.             }
  2171.             for key, booster in pairs(boosters) do
  2172.                 if ZenX.dispensesettings[key] then
  2173.                     game.ReplicatedStorage.Events.ToyEvent:FireServer(booster)
  2174.                 end
  2175.             end
  2176.         end
  2177.        
  2178.         -- Wealth Clock (trigger event)
  2179.         if ZenX.toggles.clock then
  2180.             game:GetService("ReplicatedStorage").Events.ToyEvent:FireServer("Wealth Clock")
  2181.         end
  2182.        
  2183.         -- Free Ant Pass (trigger event)
  2184.         if ZenX.toggles.freeantpass then
  2185.             game:GetService("ReplicatedStorage").Events.ToyEvent:FireServer("Free Ant Pass Dispenser")
  2186.         end
  2187.        
  2188.         -- Update the gained honey display
  2189.         gainedhoneylabel:UpdateText("Gained Honey: " .. api.suffixstring(temptable.honeycurrent - temptable.honeystart))
  2190.     end
  2191. end)
  2192.  
  2193. -- RunService Heartbeat Functions
  2194. game:GetService('RunService').Heartbeat:Connect(function()
  2195.     -- Auto Quest Toggle: Fires the quest button click event
  2196.     if ZenX.toggles.autoquest then
  2197.         local questButton = game:GetService("Players").LocalPlayer.PlayerGui.ScreenGui.NPC.ButtonOverlay.MouseButton1Click
  2198.         firesignal(questButton)
  2199.     end
  2200.    
  2201.     -- Loop Speed Toggle: Sets the player's walking speed
  2202.     if ZenX.toggles.loopspeed then
  2203.         local humanoid = game.Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
  2204.         if humanoid then
  2205.             humanoid.WalkSpeed = ZenX.vars.walkspeed
  2206.         end
  2207.     end
  2208.    
  2209.     -- Loop Jump Power Toggle: Sets the player's jump power
  2210.     if ZenX.toggles.loopjump then
  2211.         local humanoid = game.Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
  2212.         if humanoid then
  2213.             humanoid.JumpPower = ZenX.vars.jumppower
  2214.         end
  2215.     end
  2216. end)
  2217.  
  2218. game:GetService('RunService').Heartbeat:Connect(function()
  2219.     -- Get MinigameLayer to minimize repeated calls
  2220.     local minigameLayer = game.Players.LocalPlayer.PlayerGui.ScreenGui:WaitForChild("MinigameLayer")
  2221.  
  2222.     -- Loop through the children of MinigameLayer
  2223.     for _, v in pairs(minigameLayer:GetChildren()) do
  2224.         -- Loop through all descendants of the GuiGrid within each child (if it exists)
  2225.         local guiGrid = v:FindFirstChild("GuiGrid")
  2226.         if guiGrid then
  2227.             for _, q in pairs(guiGrid:GetDescendants()) do
  2228.                 -- Check if the object name matches "ObjContent" or "ObjImage"
  2229.                 if q.Name == "ObjContent" or q.Name == "ObjImage" then
  2230.                     q.Visible = true
  2231.                 end
  2232.             end
  2233.         end
  2234.     end
  2235. end)
  2236.  
  2237. game:GetService('RunService').Heartbeat:Connect(function()
  2238.     if temptable.float then
  2239.         -- Retrieve the character's humanoid root part and body scale
  2240.         local humanoidRootPart = game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart")
  2241.         local bodyTypeScale = game.Players.LocalPlayer.Character.Humanoid:WaitForChild("BodyTypeScale")
  2242.        
  2243.         -- Set body scale to 0 for floating effect (likely shrinks character)
  2244.         bodyTypeScale.Value = 0
  2245.        
  2246.         -- Assuming floatpad is a predefined object in the workspace or a global variable
  2247.         local floatpad = game.Workspace:WaitForChild("Floatpad")
  2248.        
  2249.         -- Enable collision and position the floatpad relative to the player's root part
  2250.         floatpad.CanCollide = true
  2251.         floatpad.CFrame = CFrame.new(humanoidRootPart.Position.X, humanoidRootPart.Position.Y - 3.75, humanoidRootPart.Position.Z)
  2252.        
  2253.         -- Small wait to yield the task
  2254.         task.wait(0)
  2255.     else
  2256.         -- Disable collision when float is not active
  2257.         local floatpad = game.Workspace:WaitForChild("Floatpad")
  2258.         floatpad.CanCollide = false
  2259.     end
  2260. end)
  2261.  
  2262.  
  2263. local vu = game:GetService("VirtualUser")  -- Get the VirtualUser service to simulate inputs
  2264.  
  2265. game:GetService("Players").LocalPlayer.Idled:connect(function()  -- Listen for the player's Idled event
  2266.     -- Simulate pressing and releasing the right mouse button (Button2) to prevent idle timeout
  2267.     vu:Button2Down(Vector2.new(0, 0), workspace.CurrentCamera.CFrame)  -- Simulate mouse down
  2268.     task.wait(1)  -- Wait for 1 second
  2269.     vu:Button2Up(Vector2.new(0, 0), workspace.CurrentCamera.CFrame)  -- Simulate mouse up
  2270. end)
  2271.  
  2272. local canTeleport = true
  2273. local teleportDelay = math.random(2, 5)  -- Randomized delay before teleporting to avoid patterns
  2274.  
  2275. game:GetService("Workspace").Particles.Snowflakes.ChildAdded:Connect(function(snowflake)
  2276.     if canTeleport and ZenX.toggles.farmsnowflakes then
  2277.         local hash = tostring(math.random(1, 10000))
  2278.         snowflake.Name = hash
  2279.         canTeleport = false
  2280.        
  2281.         -- Added randomness to teleportation to simulate more natural behavior
  2282.         local randomOffset = Vector3.new(math.random(-3, 3), 7.5, math.random(-3, 3))  -- Slight randomization of the teleport location
  2283.         local teleportPosition = snowflake.CFrame + randomOffset
  2284.        
  2285.         -- Simulate a smooth transition rather than instantly teleporting
  2286.         local teleportTime = math.random(0.5, 1.5)  -- Randomized teleportation duration
  2287.         local startTime = tick()
  2288.         local startCFrame = game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame
  2289.  
  2290.         -- Move to the snowflake slowly over the randomized time
  2291.         repeat
  2292.             wait(0.1)  -- Update at small intervals to mimic smooth movement
  2293.             local progress = (tick() - startTime) / teleportTime
  2294.             if progress > 1 then progress = 1 end
  2295.             local newCFrame = startCFrame:Lerp(teleportPosition, progress)
  2296.             game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame = newCFrame
  2297.         until game:GetService("Workspace").Particles.Snowflakes:FindFirstChild(hash) == nil
  2298.  
  2299.         -- Reset float and wait before enabling teleportation again
  2300.         temptable.float = false
  2301.         wait(math.random(1, 2))  -- Slight random delay after teleportation
  2302.         canTeleport = true
  2303.     end
  2304. end)
  2305.  
  2306. game.Players.LocalPlayer.CharacterAdded:Connect(function(char)
  2307.     local humanoid = char:WaitForChild("Humanoid")
  2308.    
  2309.     humanoid.Died:Connect(function()
  2310.         -- Disable autofarm on death and handle state changes smoothly
  2311.         if ZenX.toggles.autofarm then
  2312.             temptable.dead = true
  2313.             ZenX.toggles.autofarm = false
  2314.             temptable.converting = false
  2315.             temptable.farmtoken = false
  2316.             -- Adding a random delay to avoid detection by anti-cheat systems
  2317.             task.wait(math.random(3, 7))  -- Simulating some random delay after death (mimics natural behavior)
  2318.         end
  2319.        
  2320.         -- Simulate a recovery phase
  2321.         if temptable.dead then
  2322.             -- Delay for recovery and respawn logic
  2323.             task.wait(math.random(25, 30))  -- Simulate player respawning or recovering naturally
  2324.  
  2325.             -- Reset all relevant states after waiting for respawn
  2326.             temptable.dead = false
  2327.             ZenX.toggles.autofarm = true
  2328.             temptable.converting = false
  2329.             temptable.tokensfarm = true
  2330.  
  2331.             -- Simulate normal player recovery and return to farming after respawn
  2332.             local recoveryTime = math.random(5, 10)  -- Randomized time before resuming autofarm
  2333.             task.wait(recoveryTime)
  2334.  
  2335.             -- Make sure the game is not flooding with requests
  2336.             ZenX.toggles.autofarm = true
  2337.             temptable.tokensfarm = true
  2338.         end
  2339.     end)
  2340. end)
  2341.  
  2342. -- Collectibles Cleanup
  2343. for _, v in next, game.workspace.Collectibles:GetChildren() do
  2344.     -- Ensure you match specific collectible names or patterns
  2345.     if string.find(v.Name, "SomePattern") then  -- Replace "SomePattern" with the actual name pattern or condition
  2346.         pcall(function()
  2347.             v:Destroy()  -- Safely attempt to destroy the object
  2348.         end)
  2349.     end
  2350. end
  2351.  
  2352. -- Speed Monitoring
  2353. task.spawn(function()
  2354.     local lastPosition = game.Players.LocalPlayer.Character.HumanoidRootPart.Position
  2355.     while task.wait(0.1) do  -- Adjusting the wait time to reduce CPU load
  2356.         local currentPosition = game.Players.LocalPlayer.Character.HumanoidRootPart.Position
  2357.         local currentSpeed = (currentPosition - lastPosition).magnitude / 0.1  -- Speed calculation based on the time difference
  2358.         temptable.running = currentSpeed > 0
  2359.         lastPosition = currentPosition  -- Update last position for next calculation
  2360.     end
  2361. end)
  2362.  
  2363. loadingLoops:UpdateText("Loaded Loops")
  2364.  
  2365. -- Monster Name Function with improvements
  2366. local function getMonsterName(name)
  2367.     -- Ensure the name is a string before proceeding
  2368.     if type(name) ~= "string" then
  2369.         return "Invalid name"
  2370.     end
  2371.    
  2372.     local keywords = {
  2373.         ["Mushroom"] = "Ladybug",
  2374.         ["Rhino"] = "Rhino Beetle",
  2375.         ["Spider"] = "Spider",
  2376.         ["Ladybug"] = "Ladybug",
  2377.         ["Scorpion"] = "Scorpion",
  2378.         ["Mantis"] = "Mantis",
  2379.         ["Beetle"] = "Rhino Beetle",
  2380.         ["Tunnel"] = "Tunnel Bear",
  2381.         ["Coco"] = "Coconut Crab",
  2382.         ["King"] = "King Beetle",
  2383.         ["Stump"] = "Stump Snail",
  2384.         ["Were"] = "Werewolf"
  2385.     }
  2386.    
  2387.     -- Convert name to uppercase to ensure case-insensitivity
  2388.     local upperName = string.upper(name)
  2389.    
  2390.     -- Iterate over keywords and check for matches
  2391.     for keyword, fullName in pairs(keywords) do
  2392.         if string.find(upperName, string.upper(keyword)) then
  2393.             return fullName
  2394.         end
  2395.     end
  2396.    
  2397.     -- If no match is found, return the original name
  2398.     return name
  2399. end
  2400.  
  2401. -- Nearest Field Function with enhancements
  2402. local function getNearestField(part)
  2403.     -- Ensure the part has a valid position
  2404.     if not part or not part.Position then
  2405.         return nil
  2406.     end
  2407.    
  2408.     local resultingFieldPos
  2409.     local lowestMag = math.huge
  2410.  
  2411.     -- Iterate through FlowerZones to find the nearest field
  2412.     for _, v in pairs(game:GetService("Workspace").FlowerZones:GetChildren()) do
  2413.         -- Check if v has a Position property (valid field)
  2414.         if v.Position then
  2415.             local mag = (v.Position - part.Position).magnitude
  2416.             if mag < lowestMag then
  2417.                 lowestMag = mag
  2418.                 resultingFieldPos = v.Position
  2419.             end
  2420.         end
  2421.     end
  2422.  
  2423.     -- If no field is found within range, default position
  2424.     if lowestMag > 100 then
  2425.         resultingFieldPos = part.Position + Vector3.new(0, 0, 10)
  2426.     end
  2427.  
  2428.     -- Special handling for Tunnel-related parts
  2429.     if string.find(part.Name, "Tunnel") then
  2430.         resultingFieldPos = part.Position + Vector3.new(20, -70, 0)
  2431.     end
  2432.  
  2433.     -- Return the position of the nearest field or the default position
  2434.     return resultingFieldPos
  2435. end
  2436.  
  2437. -- Fetch Visual Monster String Function with enhancements
  2438. local function fetchVisualMonsterString(v)
  2439.     local mobText
  2440.     -- Check if the Attachment exists before accessing TimerGui and TimerLabel
  2441.     local attachment = v:FindFirstChild("Attachment")
  2442.     if attachment then
  2443.         local timerGui = attachment:FindFirstChild("TimerGui")
  2444.         if timerGui then
  2445.             local timerLabel = timerGui:FindFirstChild("TimerLabel")
  2446.             if timerLabel and timerLabel.Visible then
  2447.                 -- Split the timer text and extract the appropriate part
  2448.                 local splitTimer = string.split(timerLabel.Text, " ")
  2449.                 mobText = getMonsterName(v.Name) .. ": " .. (splitTimer[3] or splitTimer[2] or splitTimer[1])
  2450.             else
  2451.                 -- Timer is not visible, so mark as Ready
  2452.                 mobText = getMonsterName(v.Name) .. ": Ready"
  2453.             end
  2454.         else
  2455.             -- TimerGui does not exist, default to Ready
  2456.             mobText = getMonsterName(v.Name) .. ": Ready"
  2457.         end
  2458.     else
  2459.         -- Attachment doesn't exist, default to Ready
  2460.         mobText = getMonsterName(v.Name) .. ": Ready"
  2461.     end
  2462.    
  2463.     return mobText
  2464. end
  2465.  
  2466. -- Get Toy Cooldown Function with enhancements
  2467. local function getToyCooldown(toy)
  2468.     -- Check if the toy exists in the workspace
  2469.     if not workspace.Toys:FindFirstChild(toy) then
  2470.         return -1, false  -- Toy does not exist, return default values
  2471.     end
  2472.    
  2473.     local c = require(game.ReplicatedStorage.ClientStatCache):Get()  -- Fetch client stat cache
  2474.     local name = toy
  2475.     local lastUsedTime = c.ToyTimes[name]  -- Get last used time from ToyTimes
  2476.    
  2477.     if not lastUsedTime then
  2478.         return -1, false  -- If there's no record of the toy being used, return default values
  2479.     end
  2480.  
  2481.     -- Calculate the time remaining on the cooldown
  2482.     local t = workspace.OsTime.Value - lastUsedTime
  2483.     local cooldown = workspace.Toys[name].Cooldown.Value
  2484.     local remainingTime = cooldown - t  -- Calculate remaining cooldown time
  2485.     local canBeUsed = remainingTime < 0  -- Toy can be used if the remaining time is negative
  2486.  
  2487.     return remainingTime, canBeUsed
  2488. end
  2489.  
  2490. -- Main Task Loop
  2491. task.spawn(function()
  2492.     -- Safely wrap the entire task in a pcall for error handling
  2493.     pcall(function()
  2494.         -- Initial Setup
  2495.         loadingInfo:CreateLabel("")  -- Clear previous labels
  2496.         loadingInfo:CreateLabel("Script loaded!")  -- Notify the script is loaded
  2497.         wait(2)  -- Wait for a moment before continuing
  2498.  
  2499.         -- Cleanup Old UI Elements (Safe Error Handling)
  2500.         pcall(function()
  2501.             for _, v in pairs(game.CoreGui:GetDescendants()) do
  2502.                 if v.Name == "Startup S" then
  2503.                     -- Move the Information S panel if exists before destroying
  2504.                     v.Parent.Parent.RightSide["Information S"].Parent = v.Parent
  2505.                     v:Destroy()  -- Clean up unnecessary UI elements
  2506.                 end
  2507.             end
  2508.         end)
  2509.  
  2510.         -- Create Panels for Mob and Utility Sections
  2511.         local mobPanel = hometab:CreateSection("Mob Panel")
  2512.         local utilityPanel = hometab:CreateSection("Utility Panel")
  2513.  
  2514.         -- Table to store the mob spawners and their respective buttons
  2515.         local statusTable = {}
  2516.  
  2517.         -- Populate Mob Panel with Spawners
  2518.         for _, v in pairs(game:GetService("Workspace").MonsterSpawners:GetChildren()) do
  2519.             if not string.find(v.Name, "CaveMonster") then
  2520.                 local mobText = fetchVisualMonsterString(v)  -- Get monster name and status
  2521.                 if mobText then
  2522.                     -- Create a button for each spawner
  2523.                     local mobButton = mobPanel:CreateButton(mobText, function()
  2524.                         -- Teleport to the nearest field of the monster
  2525.                         api.tween(1, CFrame.new(getNearestField(v)))
  2526.                     end)
  2527.                     -- Add the button and associated spawner to the status table
  2528.                     table.insert(statusTable, {mobButton, v})
  2529.                 end
  2530.             end
  2531.         end
  2532.  
  2533.         -- Create Utility Buttons
  2534.         local utilities = {
  2535.             ["Red Field Booster"] = "Red Field Booster: 00:00",
  2536.             ["Blue Field Booster"] = "Blue Field Booster: 00:00",
  2537.             ["Field Booster"] = "White Field Booster: 00:00",
  2538.             ["Coconut Dispenser"] = "Coconut Dispenser: 00:00",
  2539.             ["Instant Converter"] = "Instant Converter A: 00:00",
  2540.             ["Instant Converter B"] = "Instant Converter B: 00:00",
  2541.             ["Instant Converter C"] = "Instant Converter C: 00:00",
  2542.             ["Wealth Clock"] = "Wealth Clock: 00:00",
  2543.             ["Mythic Meteor Shower"] = "Mythic Meteor Shower: 00:00"
  2544.         }
  2545.  
  2546.         -- Create buttons for each utility in the utility panel
  2547.         for toyName, label in pairs(utilities) do
  2548.             panel2:CreateButton(label, function()
  2549.                 api.tween(1, CFrame.new(game:GetService("Workspace").Toys[toyName].Platform.Position + Vector3.new(0, 5, 0)))
  2550.             end)
  2551.         end
  2552.  
  2553.         -- Main loop to update UI every second
  2554.         while wait(1) do
  2555.             -- Update Mob Panel
  2556.             if ZenX.toggles.enablestatuspanel then
  2557.                 -- Update mob status text for each spawner
  2558.                 for _, v in pairs(statusTable) do
  2559.                     if v[1] and v[2] then
  2560.                         v[1]:UpdateText(fetchVisualMonsterString(v[2]))
  2561.                     end
  2562.                 end
  2563.  
  2564.                 -- Update Mondo Chick Status
  2565.                 local clock = workspace:FindFirstChild("Clock")
  2566.                 if clock and clock:FindFirstChild("SurfaceGui") and clock.SurfaceGui:FindFirstChild("TextLabel") then
  2567.                     local textLabel = clock.SurfaceGui.TextLabel
  2568.                     local mondoChickStatus = (textLabel.Text == "! ! !" and "Mondo Chick: Ready") or "Mondo Chick: " .. string.gsub(textLabel.Text, "\n", "")
  2569.                     mob2:UpdateText(mondoChickStatus)
  2570.                 end
  2571.  
  2572.                 -- Update Utility Panel
  2573.                 -- Update Wind Shrine cooldown status
  2574.                 local cooldown = require(game.ReplicatedStorage.TimeString)(3600 - (require(game.ReplicatedStorage.OsTime)() - (require(game.ReplicatedStorage.StatTools).GetLastCooldownTime(v1, "WindShrine") or 0)))
  2575.                 windUpd:UpdateText(cooldown == "" and "Wind Shrine: Ready" or "Wind Shrine: " .. cooldown)
  2576.  
  2577.                 -- Update the cooldown status for each utility
  2578.                 for i, v in pairs(utilities) do
  2579.                     local cooldown, isUsable = getToyCooldown(i)
  2580.                     if cooldown and isUsable then
  2581.                         v:UpdateText(isUsable and (i .. ": Ready") or (i .. ": " .. require(game.ReplicatedStorage.TimeString)(cooldown)))
  2582.                     end
  2583.                 end
  2584.             end
  2585.         end
  2586.     end)
  2587. end)
  2588.  
  2589. -- Load Auto Configuration if Available
  2590. if _G.autoload and isfile("ZenX/BSS_" .. _G.autoload .. ".json") then
  2591.     local jsonData = readfile("ZenX/BSS_" .. _G.autoload .. ".json")
  2592.     ZenX = game:service'HttpService':JSONDecode(jsonData)
  2593. end
  2594.  
  2595. -- Helper function to disable collisions and set transparency for parts
  2596. local function disableCollisionsAndSetTransparency(part)
  2597.     if part:IsA("BasePart") then
  2598.         part.CanCollide = false
  2599.         part.Transparency = math.max(part.Transparency, 0.5)  -- Ensure transparency is not less than 0.5
  2600.     end
  2601. end
  2602.  
  2603. -- Disable Collisions and Set Transparency for Field Decorations
  2604. local fieldDecos = workspace:FindFirstChild("FieldDecos")
  2605. if fieldDecos then
  2606.     for _, part in next, fieldDecos:GetDescendants() do
  2607.         disableCollisionsAndSetTransparency(part)
  2608.         task.wait()  -- Wait to prevent performance issues
  2609.     end
  2610. end
  2611.  
  2612. -- Disable Collisions and Set Transparency for Specific Decorations (Bushes and Blue Flowers)
  2613. local decorations = workspace:FindFirstChild("Decorations")
  2614. if decorations then
  2615.     for _, part in next, decorations:GetDescendants() do
  2616.         if part:IsA("BasePart") and (part.Parent.Name == "Bush" or part.Parent.Name == "Blue Flower") then
  2617.             disableCollisionsAndSetTransparency(part)
  2618.             task.wait()  -- Wait to prevent performance issues
  2619.         end
  2620.     end
  2621. end
  2622.  
  2623. -- Set Transparency for Mushrooms in Misc Decorations
  2624. local miscDecorations = workspace:FindFirstChild("Decorations") and workspace.Decorations:FindFirstChild("Misc")
  2625. if miscDecorations then
  2626.     for _, v in next, miscDecorations:GetDescendants() do
  2627.         if v.Parent.Name == "Mushroom" then
  2628.             v.CanCollide = false
  2629.             v.Transparency = 0.5
  2630.         end
  2631.     end
  2632. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement