Advertisement
Egorikusa

AUTOFARMPSX

May 21st, 2023
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 75.94 KB | None | 0 0
  1. -- Important Variables
  2. local SCRIPT_NAME = "Rafa PSX GUI"
  3. local SCRIPT_VERSION = "v0.4" -- Hey rafa remember to change it before updating lmao
  4.  
  5. -- Detect if the script has executed by AutoExec
  6. local AutoExecuted = false
  7. if not game:IsLoaded() then AutoExecuted = true end
  8.  
  9. repeat task.wait() until game.PlaceId ~= nil
  10. if not game:IsLoaded() then game.Loaded:Wait() end
  11.  
  12. --//-------------- SERVICES ----------------//*
  13. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  14. local Players = game:GetService("Players")
  15. local LocalPlayer = Players.LocalPlayer
  16. local HttpService = game:GetService("HttpService")
  17. local InputService = game:GetService('UserInputService')
  18. local RunService = game:GetService('RunService')
  19. local ContentProvider = game:GetService("ContentProvider")
  20.  
  21. --//*--------- GLOBAL VARIABLES -----------//*
  22. local ScriptIsCurrentlyBusy = false
  23. local Character = nil
  24. local Humanoid = nil
  25. local HumanoidRootPart = nil
  26. local CurrentWorld = ""
  27. local CurrentPosition = nil
  28.  
  29. local Settings_DisableRendering = true
  30.  
  31. local Webhook_Enabled = false
  32. local Webhook_URL = ""
  33. local Webhook_Daycare = true
  34. local Webhook_Huge = true
  35.  
  36. LocalPlayer.CharacterAdded:Connect(function(char)
  37. Character = char
  38. Humanoid = Character:WaitForChild("Humanoid")
  39. HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
  40. end)
  41.  
  42. if game.PlaceId == 6284583030 or game.PlaceId == 10321372166 or game.PlaceId == 7722306047 or game.PlaceId == 12610002282 then
  43.  
  44. local banSuccess, banError = pcall(function()
  45. local Blunder = require(game:GetService("ReplicatedStorage"):WaitForChild("X", 10):WaitForChild("Blunder", 10):WaitForChild("BlunderList", 10))
  46. if not Blunder or not Blunder.getAndClear then LocalPlayer:Kick("Error while bypassing the anti-cheat! (Didn't find blunder)") end
  47.  
  48. local OldGet = Blunder.getAndClear
  49. setreadonly(Blunder, false)
  50. local function OutputData(Message)
  51. print("-- PET SIM X BLUNDER --")
  52. print(Message .. "\n")
  53. end
  54.  
  55. Blunder.getAndClear = function(...)
  56. local Packet = ...
  57. for i,v in next, Packet.list do
  58. if v.message ~= "PING" then
  59. OutputData(v.message)
  60. table.remove(Packet.list, i)
  61. end
  62. end
  63. return OldGet(Packet)
  64. end
  65.  
  66. setreadonly(Blunder, true)
  67. end)
  68.  
  69. if not banSuccess then
  70. LocalPlayer:Kick("Error while bypassing the anti-cheat! (".. banError ..")")
  71. return
  72. end
  73.  
  74. local Library = require(game:GetService("ReplicatedStorage").Library)
  75. assert(Library, "Oopps! Library has not been loaded. Maybe try re-joining?")
  76. while not Library.Loaded do task.wait() end
  77.  
  78. Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
  79. Humanoid = Character:WaitForChild("Humanoid")
  80. HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
  81.  
  82.  
  83. local bypassSuccess, bypassError = pcall(function()
  84. if not Library.Network then
  85. LocalPlayer:Kick("Network not found, can't bypass!")
  86. end
  87.  
  88. if not Library.Network.Invoke or not Library.Network.Fire then
  89. LocalPlayer:Kick("Network Invoke/Fire was not found! Failed to bypass!")
  90. end
  91.  
  92. hookfunction(debug.getupvalue(Library.Network.Invoke, 1), function(...) return true end)
  93. -- Currently we don't need to hook Fire, since both Invoke/Fire have the same upvalue, this may change in future.
  94. -- hookfunction(debug.getupvalue(Library.Network.Fire, 1), function(...) return true end)
  95.  
  96. local originalPlay = Library.Audio.Play
  97. Library.Audio.Play = function(...)
  98. if checkcaller() then
  99. local audioId, parent, pitch, volume, maxDistance, group, looped, timePosition = unpack({ ... })
  100. if type(audioId) == "table" then
  101. audioId = audioId[Random.new():NextInteger(1, #audioId)]
  102. end
  103. if not parent then
  104. warn("Parent cannot be nil", debug.traceback())
  105. return nil
  106. end
  107. if audioId == 0 then return nil end
  108.  
  109. if type(audioId) == "number" or not string.find(audioId, "rbxassetid://", 1, true) then
  110. audioId = "rbxassetid://" .. audioId
  111. end
  112. if pitch and type(pitch) == "table" then
  113. pitch = Random.new():NextNumber(unpack(pitch))
  114. end
  115. if volume and type(volume) == "table" then
  116. volume = Random.new():NextNumber(unpack(volume))
  117. end
  118. if group then
  119. local soundGroup = game.SoundService:FindFirstChild(group) or nil
  120. else
  121. soundGroup = nil
  122. end
  123. if timePosition == nil then
  124. timePosition = 0
  125. else
  126. timePosition = timePosition
  127. end
  128. local isGargabe = false
  129. if not pcall(function() local _ = parent.Parent end) then
  130. local newParent = parent
  131. pcall(function()
  132. newParent = CFrame.new(newParent)
  133. end)
  134. parent = Instance.new("Part")
  135. parent.Anchored = true
  136. parent.CanCollide = false
  137. parent.CFrame = newParent
  138. parent.Size = Vector3.new()
  139. parent.Transparency = 1
  140. parent.Parent = workspace:WaitForChild("__DEBRIS")
  141. isGargabe = true
  142. end
  143. local sound = Instance.new("Sound")
  144. sound.SoundId = audioId
  145. sound.Name = "sound-" .. audioId
  146. sound.Pitch = pitch and 1
  147. sound.Volume = volume and 0.5
  148. sound.SoundGroup = soundGroup
  149. sound.Looped = looped and false
  150. sound.MaxDistance = maxDistance and 100
  151. sound.TimePosition = timePosition
  152. sound.RollOffMode = Enum.RollOffMode.Linear
  153. sound.Parent = parent
  154. if not require(game:GetService("ReplicatedStorage"):WaitForChild("Library"):WaitForChild("Client")).Settings.SoundsEnabled then
  155. sound:SetAttribute("CachedVolume", sound.Volume)
  156. sound.Volume = 0
  157. end
  158. sound:Play()
  159. getfenv(originalPlay).AddToGarbageCollection(sound, isGargabe)
  160. return sound
  161. end
  162.  
  163. return originalPlay(...)
  164. end
  165.  
  166. end)
  167.  
  168. if not bypassSuccess then
  169. print(bypassError)
  170. LocalPlayer:Kick("Error while bypassing network, try again or wait for an update!")
  171. return
  172. end
  173.  
  174. LocalPlayer.PlayerScripts:WaitForChild("Scripts", 10):WaitForChild("Game", 10):WaitForChild("Coins", 10)
  175. LocalPlayer.PlayerScripts:WaitForChild("Scripts", 10):WaitForChild("Game", 10):WaitForChild("Pets", 10)
  176. wait()
  177. -- local orbsScript = getsenv(game.Players.LocalPlayer.PlayerScripts.Scripts.Game:WaitForChild("Orbs", 10))
  178. -- local CollectOrb = orbsScript.Collect
  179.  
  180. local GetRemoteFunction = debug.getupvalue(Library.Network.Invoke, 2)
  181. -- OrbList = debug.getupvalue(orbsScript.Collect, 1)
  182. local CoinsTable = debug.getupvalue(getsenv(LocalPlayer.PlayerScripts.Scripts.Game:WaitForChild("Coins", 10)).DestroyAllCoins, 1)
  183. local RenderedPets = debug.getupvalue(getsenv(LocalPlayer.PlayerScripts.Scripts.Game:WaitForChild("Pets", 10)).NetworkUpdate, 1)
  184.  
  185.  
  186. local IsHardcore = Library.Shared.IsHardcore
  187.  
  188. local AllGameWorlds = {}
  189. for name, world in pairs(Library.Directory.Worlds) do
  190. if name ~= "WIP" and name ~= "Trading Plaza" and not world.disabled and world.worldOrder and world.worldOrder ~= 0 then
  191. world.name = name
  192. table.insert(AllGameWorlds, world)
  193. end
  194. end
  195.  
  196. table.sort(AllGameWorlds, function(a, b)
  197. return a.worldOrder < b.worldOrder
  198. end)
  199.  
  200.  
  201. local WorldWithAreas = {}
  202. for areaName, area in pairs(Library.Directory.Areas) do
  203. if area and area.world then
  204. local world = Library.Directory.Worlds[area.world]
  205. local containsSpawn = false
  206.  
  207. if world and world.spawns then
  208. for spawnName, spawn in pairs(world.spawns) do
  209. if spawn.settings and spawn.settings.area and spawn.settings.area == name then
  210. containsSpawn = true
  211. break
  212. end
  213. end
  214. end
  215.  
  216. if containsSpawn then
  217. if not WorldWithAreas[area.world] then
  218. WorldWithAreas[area.world] = {}
  219. end
  220.  
  221. table.insert(WorldWithAreas[area.world], area.name)
  222. end
  223. end
  224. end
  225.  
  226.  
  227. function GetAllAreasInWorld(world)
  228. -- local AllAreasInSelectedWorld = {}
  229.  
  230. -- for name, area in pairs(Library.Directory.Areas) do
  231. -- local containsSpawn = false
  232. -- for spawnName, spawn in pairs(world.spawns) do
  233. -- if spawn.settings and spawn.settings.area and spawn.settings.area == name then
  234. -- containsSpawn = true
  235. -- break
  236. -- end
  237. -- end
  238.  
  239. -- if area.world == world.name and containsSpawn then
  240. -- table.insert(AllAreasInSelectedWorld, name)
  241. -- end
  242. -- end
  243.  
  244. -- table.sort(AllAreasInSelectedWorld, function(a, b)
  245. -- local areaA = Library.Directory.Areas[a]
  246. -- local areaB = Library.Directory.Areas[b]
  247. -- return areaA.id < areaB.id
  248. -- end)
  249.  
  250. -- return AllAreasInSelectedWorld
  251. return WorldWithAreas[world] or {}
  252. end
  253.  
  254. --// AUTO COMPLETE game
  255. local AllGameAreas = {}
  256.  
  257. for name, area in pairs(Library.Directory.Areas) do
  258. local world = Library.Directory.Worlds[area.world]
  259. if world and world.worldOrder and world.worldOrder > 0 then
  260. if not area.hidden and not area.isVIP then
  261. local containsArea = false
  262. if world.spawns then
  263. for i,v in pairs(world.spawns) do
  264. if v.settings and v.settings.area and v.settings.area == name then
  265. containsArea = true
  266. break
  267. end
  268. end
  269. end
  270.  
  271. if area.gate or containsArea then
  272. table.insert(AllGameAreas, name)
  273. end
  274. end
  275. end
  276. end
  277.  
  278.  
  279.  
  280. table.sort(AllGameAreas, function(a, b)
  281. local areaA = Library.Directory.Areas[a]
  282. local areaB = Library.Directory.Areas[b]
  283.  
  284. local worldA = Library.Directory.Worlds[areaA.world]
  285. if a == "Ice Tech" then
  286. worldA = Library.Directory.Worlds["Fantasy"]
  287. end
  288.  
  289. local worldB = Library.Directory.Worlds[areaB.world]
  290. if b == "Ice Tech" then
  291. worldB = Library.Directory.Worlds["Fantasy"]
  292. end
  293.  
  294. if worldA.worldOrder ~= worldB.worldOrder then
  295. return worldA.worldOrder < worldB.worldOrder
  296. end
  297.  
  298. local currencyA = Library.Directory.Currency[worldA.mainCurrency]
  299. local currencyB = Library.Directory.Currency[worldB.mainCurrency]
  300. if currencyA.order ~= currencyB.order then
  301. return currencyA.order < currencyB.order
  302. end
  303.  
  304. if not areaA.gate or not areaB.gate then
  305. return areaA.id < areaB.id
  306. end
  307.  
  308. return areaA.gate.cost < areaB.gate.cost
  309. end)
  310.  
  311.  
  312. function GetCurrentAndNextArea()
  313. local cArea, nArea = "", ""
  314.  
  315.  
  316. for i, v in ipairs(AllGameAreas) do
  317. if cArea == "" and Library.WorldCmds.HasArea(v) then
  318. local nxtArea = AllGameAreas[i + 1]
  319. if nxtArea and not Library.WorldCmds.HasArea(nxtArea) then
  320. cArea = v
  321. nArea = nxtArea
  322. break
  323. elseif not nxtArea then
  324. cArea = v
  325. nArea = "COMPLETED"
  326. end
  327. end
  328. end
  329.  
  330.  
  331. return cArea, nArea
  332. end
  333.  
  334.  
  335. function CheckIfCanAffordArea(areaName)
  336. local saveData = Library.Save.Get()
  337. local area = Library.Directory.Areas[areaName]
  338.  
  339. if not saveData then
  340. return false
  341. end
  342.  
  343. if not area then return false end
  344.  
  345. if not area.gate then
  346. return true
  347. end -- Area is free =)
  348.  
  349. local gateCurrency = area.gate.currency
  350. local currency = saveData[gateCurrency]
  351. if IsHardcore then
  352. if gateCurrency ~= "Diamonds" then
  353. currency = saveData.HardcoreCurrency[gateCurrency]
  354. end
  355. end
  356.  
  357. if currency and currency >= area.gate.cost then
  358. return true
  359. end
  360.  
  361. return false
  362. end
  363.  
  364. -- TODO: Implement huge webhook notifier
  365. function RewardsRedeemed(rewards)
  366.  
  367. for v, rewardBox in pairs(rewards) do
  368. local reward, quantity = unpack(rewardBox)
  369. if Webhook_Huge and reward == "Huge Pet" then
  370. local petId = quantity
  371. local petData = Library.Directory.Pets[petId]
  372. if petData then
  373. SendWebhook()
  374. end
  375. end
  376. print(quantity, reward)
  377. end
  378.  
  379. end
  380.  
  381. Library.Network.Fired("Rewards Redeemed"):Connect(function(rewards)
  382. RewardsRedeemed(rewards)
  383. end)
  384.  
  385. Library.Signal.Fired("Rewards Redeemed"):Connect(function(rewards)
  386. RewardsRedeemed(rewards)
  387. end)
  388.  
  389. local GetCoinsInstance = GetRemoteFunction("Get Coins")
  390. local OpenEggInstance = GetRemoteFunction("Buy Egg")
  391. -- print(OpenEggInstance, typeof(OpenEggInstance))
  392. local metatable = getrawmetatable(game)
  393. setreadonly(metatable, false)
  394. local oldNamecall = metatable.__namecall
  395.  
  396. metatable.__namecall = function(self, ...)
  397. local InstanceMethod = getnamecallmethod()
  398. local args = {...}
  399.  
  400. if InstanceMethod == "InvokeServer" then
  401. if self == OpenEggInstance then
  402. LastOpenEggId = args[1]
  403. LastOpenEggData = Library.Directory.Eggs[LastOpenEggId]
  404. LastHatchSetting = "Normal"
  405.  
  406. if args[2] then
  407. LastHatchSetting = "Triple"
  408. end
  409.  
  410. if args[3] then
  411. LastHatchSetting = "Octuple"
  412. end
  413.  
  414. coroutine.wrap(function()
  415. while true do
  416. SaveCustomFlag("CurrentEgg", LastOpenEggId)
  417. wait()
  418. SaveCustomFlag("CurrentHatchSettings", LastHatchSetting)
  419. break
  420. end
  421. end)()
  422. end
  423. end
  424.  
  425. return oldNamecall(self, ...)
  426. end
  427.  
  428. setreadonly(metatable, true)
  429.  
  430. -- local originalInvokeServer = OpenEggInstance.InvokeServer
  431. -- originalInvokeServer = hookfunction(OpenEggInstance.InvokeServer, newcclosure(function(...)
  432. -- local args = {...}
  433. -- print(args[1])
  434. -- -- if self == OpenEggInstance then
  435. -- LastOpenEggId = args[1]
  436. -- LastOpenEggData = Library.Directory.Eggs[LastOpenEggId]
  437. -- LastHatchSetting = "Normal"
  438.  
  439. -- if args[2] then
  440. -- LastHatchSetting = "Triple"
  441. -- end
  442.  
  443. -- if args[3] then
  444. -- LastHatchSetting = "Octuple"
  445. -- end
  446.  
  447. -- coroutine.wrap(function()
  448. -- while true do
  449. -- SaveCustomFlag("CurrentEgg", LastOpenEggId)
  450. -- wait()
  451. -- SaveCustomFlag("CurrentHatchSettings", LastHatchSetting)
  452. -- break
  453. -- end
  454. -- end)()
  455. -- -- end
  456.  
  457. -- return originalInvokeServer(...)
  458. -- end))
  459.  
  460.  
  461.  
  462. local fastPets = false
  463. local Original_HasPower = Library.Shared.HasPower
  464. Library.Shared.HasPower = function(pet, powerName)
  465. if fastPets and powerName == "Agility" then
  466. return true, 3
  467. end
  468. return Original_HasPower(pet, powerName)
  469. end
  470.  
  471. local Original_GetPowerDir = Library.Shared.GetPowerDir
  472. Library.Shared.GetPowerDir = function(powerName, tier)
  473. if fastPets and powerName == "Agility" then
  474. return {
  475. title = "Agility III",
  476. desc = "Pet moves 50% faster",
  477. value = 20
  478. }
  479. end
  480. return Original_GetPowerDir(powerName, tier)
  481. end
  482.  
  483. getgenv().SecureMode = true
  484. getgenv().DisableArrayfieldAutoLoad = true
  485.  
  486. local Rayfield = nil
  487. if isfile("UI/ArrayField.lua") then
  488. Rayfield = loadstring(readfile("UI/ArrayField.lua"))()
  489. else
  490. Rayfield = loadstring(game:HttpGet("https://raw.githubusercontent.com/Rafacasari/ArrayField/main/v2.lua"))()
  491. end
  492.  
  493. -- local Rayfield = (isfile("UI/ArrayField.lua") and loadstring(readfile("UI/ArrayField.lua"))()) or loadstring(game:HttpGet("https://raw.githubusercontent.com/Rafacasari/ArrayField/main/v2.lua"))()
  494. assert(Rayfield, "Oopps! Rayfield has not been loaded. Maybe try re-joining?")
  495.  
  496.  
  497. local Window = Rayfield:CreateWindow({
  498. Name = "Pet Simulator GUI | by Rafa ",
  499. LoadingTitle = SCRIPT_NAME .. " " .. SCRIPT_VERSION,
  500. LoadingSubtitle = "by Rafa",
  501. ConfigurationSaving = {
  502. Enabled = true,
  503. FolderName = "Rafa",
  504. FileName = "PetSimulatorX_" .. tostring(LocalPlayer.UserId)
  505. },
  506. OldTabLayout = true
  507. })
  508.  
  509. coroutine.wrap(function()
  510. wait(0.5)
  511. if not isfile("Rafa/AcceptedTerms.txt") then
  512. Window:Prompt({
  513. Title = 'Disclaimer',
  514. SubTitle = 'Misuse of this script may result in penalties!',
  515. Content = "I am not responsible for any harm caused by this tool, use at your own risk.",
  516. Actions = {
  517.  
  518. Accept = {
  519. Name = "Ok",
  520. Callback = function()
  521. if not isfolder("Rafa") then makefolder("Rafa") end
  522. writefile("Rafa/AcceptedTerms.txt", "true")
  523. end,
  524.  
  525. }
  526. }
  527. })
  528. end
  529.  
  530. end)()
  531.  
  532.  
  533. function AddCustomFlag(flagName, defaultValue, callback)
  534. if Rayfield and Rayfield.Flags and not Rayfield.Flags[flagName] then
  535. local newFlag = {
  536. CurrentValue = defaultValue
  537. }
  538.  
  539. function newFlag:Set(newValue)
  540. Rayfield.Flags[flagName].CurrentValue = newValue
  541.  
  542. callback(newValue)
  543. end
  544.  
  545. Rayfield.Flags[flagName] = newFlag
  546. end
  547. end
  548.  
  549. function SaveCustomFlag(flagName, value)
  550. if Rayfield and Rayfield.Flags and Rayfield.Flags[flagName] then
  551. pcall(function()
  552. Rayfield.Flags[flagName]:Set(value)
  553.  
  554. coroutine.wrap(function()
  555. Rayfield.SaveConfiguration()
  556. end)()
  557. end)
  558. end
  559. end
  560.  
  561.  
  562.  
  563. Library.ChatMsg.New(string.format("Hello, %s! You're running %s %s", LocalPlayer.DisplayName, SCRIPT_NAME, SCRIPT_VERSION), Color3.fromRGB(175, 70, 245))
  564.  
  565. --local mainTab = Window:CreateTab("Main", "12434808810")
  566.  
  567.  
  568. -- task.spawn(function()
  569. -- while true do
  570. -- stats:Set({Title = "Hello, " .. LocalPlayer.DisplayName, Content = string.format("There are some useful information:\nServer age: %s\n", Library.Functions.TimeString(workspace.DistributedGameTime, true))})
  571. -- task.wait(1)
  572. -- end
  573. -- end)
  574.  
  575. LocalPlayer.PlayerScripts:WaitForChild("Scripts", 10):WaitForChild("Game", 10)
  576.  
  577.  
  578. local autoFarmTab = Window:CreateTab("Farm", "13075651575", true)
  579. local stats = autoFarmTab:CreateParagraph({Title = "Hello, <b><font color=\"#2B699F\">" .. LocalPlayer.DisplayName .. "</font></b>!", Content = "Thanks for using my script! - Rafa\nMake sure to join us at <b><font color=\"#2B699F\">discord.gg/MilkUp</font></b>"})
  580. local autoFarmSection = autoFarmTab:CreateSection("Auto Farm", false, false, "7785988164")
  581. local enableAutoFarm = false
  582. autoFarmTab:CreateToggle({
  583. Name = "Enable Auto-Farm",
  584. Info = 'Auto Farm will automatically destroy/farm coins for you, be aware of the risks of abusing it',
  585. Flag = "AutoFarm_Enabled",
  586. SectionParent = autoFarmSection,
  587. CurrentValue = false,
  588. Callback = function(Value)
  589. enableAutoFarm = Value
  590. end
  591. })
  592.  
  593. local AutoFarm_FastMode = false
  594. autoFarmTab:CreateToggle({
  595. Name = "Fast Mode (unlegit farm)",
  596. Flag = "AutoFarm_FastMode",
  597. SectionParent = autoFarmSection,
  598. CurrentValue = false,
  599. Callback = function(Value)
  600. AutoFarm_FastMode = Value
  601. end
  602. })
  603.  
  604. local AutoFarm_FarmSpeed = 0.3
  605. autoFarmTab:CreateSlider({
  606. Name = "Farm Speed",
  607. Flag = "AutoFarm_FarmSpeed",
  608. SectionParent = autoFarmSection,
  609. Range = {0.05, 2},
  610. Increment = 0.05,
  611. Suffix = "Second(s)",
  612. CurrentValue = 0.3,
  613. Callback = function(Value)
  614. AutoFarm_FarmSpeed = Value
  615. end,
  616. })
  617.  
  618. local farmMaxDistance = 150
  619. autoFarmTab:CreateSlider({
  620. Name = "Farm Max Distance",
  621. Flag = "AutoFarm_MaxDistance",
  622. SectionParent = autoFarmSection,
  623. Range = {10, tonumber(Library.Settings.CoinGrabDistance) or 300},
  624. Increment = 1,
  625. Suffix = "Studs",
  626. CurrentValue = 150,
  627. Callback = function(Value)
  628. farmMaxDistance = Value
  629. end,
  630. })
  631.  
  632. local farmPreferences = autoFarmTab:CreateSection("Farm Priority", false, true)
  633. local farmFocusListText = autoFarmTab:CreateParagraph({Title = "Current Farming", Content = "Nothing"}, farmPreferences)
  634.  
  635. local DefaultFarmFocusList = {
  636. "Fruits",
  637. "Highest Multiplier",
  638. "Diamonds",
  639. "Lowest Life",
  640. "Highest Life",
  641. "Nearest",
  642. "Longest"
  643. }
  644.  
  645. function CalcMultiplier(coinBonus)
  646. if not coinBonus then return 0 end
  647. local totalMultiplier = 0
  648. if coinBonus.l then
  649.  
  650. for _, v in pairs(coinBonus.l) do
  651. pcall(function()
  652. if v.m and tonumber(v.m) then
  653. totalMultiplier = totalMultiplier + v.m
  654. end
  655. end)
  656. end
  657.  
  658. end
  659. return totalMultiplier
  660. end
  661.  
  662.  
  663. local FarmFocusList = {}
  664. local FarmFocusListButtons = {}
  665.  
  666.  
  667. function UpdateFarmFocusUI()
  668. local farmingText = ""
  669. if not FarmFocusList or #FarmFocusList < 1 then
  670. farmingText = "There is nothing on your priority list!\nAdd some by <b>clicking on buttons</b>!"
  671. else
  672. for i, v in ipairs(FarmFocusList) do
  673. farmingText = farmingText .. (farmingText == "" and "This is your priority list to farm.\nYou can <b>modify it by clicking on buttons</b>!\n\n" or "\n") .. i .. "° - <b>" .. tostring(v) .. "</b>"
  674. end
  675. end
  676.  
  677. farmFocusListText:Set({Title = "Current Farming", Content = farmingText})
  678.  
  679. for _, button in pairs(FarmFocusListButtons) do
  680. local buttonName = button.Button.Name
  681. if buttonName then
  682. if table.find(FarmFocusList, buttonName) then
  683. button:Set(nil, "Remove")
  684. else
  685. button:Set(nil, "Add")
  686. end
  687. end
  688. end
  689. end
  690.  
  691.  
  692.  
  693. for _, focusName in pairs(DefaultFarmFocusList) do
  694. local function UpdateButton(text, interact)
  695. if not FarmFocusListButtons[focusName] then return end
  696. while true do
  697. wait()
  698. FarmFocusListButtons[focusName]:Set(text, interact)
  699. break
  700. end
  701. end
  702.  
  703. FarmFocusListButtons[focusName] = autoFarmTab:CreateButton({
  704. Name = focusName,
  705. SectionParent = farmPreferences,
  706. Interact = table.find(FarmFocusList, focusName) and "Remove" or "Add",
  707. CurrentValue = false,
  708. Callback = function(Value)
  709. if table.find(FarmFocusList, focusName) then
  710. table.remove(FarmFocusList, table.find(FarmFocusList, focusName))
  711. -- UpdateButton(nil, "Add")
  712. else
  713. table.insert(FarmFocusList, focusName)
  714. -- UpdateButton(nil, "Remove")
  715. end
  716.  
  717.  
  718.  
  719. coroutine.wrap(function()
  720. while true do
  721. wait()
  722. UpdateFarmFocusUI()
  723. break
  724. end
  725. end)
  726.  
  727. SaveCustomFlag("AutoFarm_FarmFocusList", FarmFocusList)
  728. end
  729. })
  730.  
  731. -- FarmFocusListButtons[focusName]:Disable("Coming soon")
  732. end
  733.  
  734.  
  735.  
  736. AddCustomFlag("AutoFarm_FarmFocusList", {}, function(newTable)
  737. FarmFocusList = newTable
  738.  
  739. local hasChanges = false
  740.  
  741. for i, v in pairs(FarmFocusList) do
  742. if not table.find(DefaultFarmFocusList, v) then
  743. table.remove(FarmFocusList, i)
  744. hasChanges = true
  745. end
  746. end
  747.  
  748.  
  749.  
  750. if hasChanges then
  751. coroutine.wrap(function()
  752. wait()
  753. SaveCustomFlag("AutoFarm_FarmFocusList", FarmFocusList)
  754. end)
  755. end
  756.  
  757. UpdateFarmFocusUI()
  758. end)
  759.  
  760.  
  761. local farmUtilities = autoFarmTab:CreateSection("Farm Utilities", false, true)
  762. local FarmUtilities_CollectDrops = false
  763. local FarmUtilities_CurrentOrbs = {}
  764. autoFarmTab:CreateToggle({
  765. Name = "Collect Drops",
  766. SectionParent = farmUtilities,
  767. CurrentValue = false,
  768. Flag = "FarmUtilities_CollectDrops",
  769. Callback = function(Value)
  770. FarmUtilities_CollectDrops = Value
  771.  
  772. if Value then
  773. table.clear(FarmUtilities_CurrentOrbs)
  774. FarmUtilities_CurrentOrbs = {}
  775. CollectAllOrbs()
  776. CollectAllLootbags()
  777. end
  778.  
  779. if not FarmUtilities_CollectDrops then return end
  780. task.spawn(function()
  781.  
  782. while FarmUtilities_CollectDrops do
  783. wait(0.05)
  784. if not FarmUtilities_CollectDrops then break end
  785. if FarmUtilities_CurrentOrbs and #FarmUtilities_CurrentOrbs > 0 then
  786. Library.Network.Fire("Claim Orbs", FarmUtilities_CurrentOrbs)
  787. table.clear(FarmUtilities_CurrentOrbs)
  788. FarmUtilities_CurrentOrbs = {}
  789. end
  790. end
  791.  
  792. end)
  793. end
  794. })
  795.  
  796. function CollectAllOrbs()
  797. pcall(function()
  798.  
  799. local OrbsToCollect = {}
  800. for orbId, orb in pairs(Library.Things:FindFirstChild("Orbs"):GetChildren()) do
  801. if not FarmUtilities_CollectDrops then break end
  802. if orbId and orb then
  803. table.insert(OrbsToCollect, orb.Name)
  804. end
  805. end
  806.  
  807. if OrbsToCollect and #OrbsToCollect > 0 and FarmUtilities_CollectDrops then
  808. Library.Network.Fire("Claim Orbs", OrbsToCollect)
  809. end
  810. end)
  811. end
  812.  
  813. function CollectAllLootbags()
  814. pcall(function()
  815. for _, lootbag in pairs(Library.Things:FindFirstChild("Lootbags"):GetChildren()) do
  816. if not FarmUtilities_CollectDrops then break end
  817.  
  818. if lootbag and not lootbag:GetAttribute("Collected") then
  819. Library.Network.Fire("Collect Lootbag", lootbag.Name, HumanoidRootPart.Position + Vector3.new(math.random(-0.05, 0.05), math.random(-0.05, 0.05), math.random(-0.05, 0.05)))
  820. wait(0.03)
  821. end
  822. end
  823. end)
  824. end
  825.  
  826. Library.Things:FindFirstChild("Lootbags").ChildAdded:Connect(function(child)
  827. wait()
  828. if FarmUtilities_CollectDrops and child then
  829. Library.Network.Fire("Collect Lootbag", child.Name, HumanoidRootPart.Position + Vector3.new(math.random(-0.05, 0.05), math.random(-0.05, 0.05), math.random(-0.05, 0.05)))
  830. end
  831. end)
  832.  
  833. Library.Things:FindFirstChild("Orbs").ChildAdded:Connect(function(child)
  834. task.wait()
  835. if FarmUtilities_CollectDrops and child then
  836. table.insert(FarmUtilities_CurrentOrbs, child.name)
  837. end
  838. end)
  839.  
  840. autoFarmTab:CreateToggle({
  841. Name = "Fast Pets",
  842. SectionParent = farmUtilities,
  843. CurrentValue = false,
  844. Flag = "FarmUtilities_FastPets",
  845. Callback = function(Value)
  846. fastPets = Value
  847. end
  848. })
  849.  
  850. local instantFall = false
  851. autoFarmTab:CreateToggle({
  852. Name = "Instant Fall Coins",
  853. SectionParent = farmUtilities,
  854. CurrentValue = false,
  855. Flag = "FarmUtilities_InstantFallCoins",
  856. Callback = function(Value)
  857. instantFall = Value
  858. end
  859. })
  860.  
  861. local WorldCoins = Library.Things:WaitForChild("Coins")
  862.  
  863. WorldCoins.ChildAdded:Connect(function(ch)
  864. if instantFall then
  865. ch:SetAttribute("HasLanded", true)
  866. ch:SetAttribute("IsFalling", false)
  867.  
  868. local coin = ch:WaitForChild("Coin")
  869. coin:SetAttribute("InstantLand", true)
  870. end
  871. end)
  872.  
  873. local areaToFarmSection = autoFarmTab:CreateSection("Areas to Farm", false, true)
  874. for w, world in ipairs(AllGameWorlds) do
  875. coroutine.wrap(function()
  876. if world and world.name then
  877. local containsSpawns = false
  878. if world.spawns then
  879. for i,v in pairs(world.spawns) do containsSpawns = true break end
  880. end
  881.  
  882. if containsSpawns then
  883. local worldDropdown = autoFarmTab:CreateDropdown({
  884. Name = world.name,
  885. MultiSelection = true,
  886. CurrentOption = {},
  887. Flag = "SelectedAreas_" .. world.name,
  888. Icon = Library.Directory.Currency[world.mainCurrency].tinyImage,
  889. Options = GetAllAreasInWorld(world),
  890. SectionParent = areaToFarmSection,
  891. Callback = function(Option)
  892.  
  893. end
  894. })
  895. worldDropdown:Lock("Coming soon!", true)
  896. end
  897. end
  898. end)()
  899. end
  900.  
  901. function GetCoinsInArea(area)
  902. local coinsInArea = {}
  903.  
  904.  
  905. for _, coin in pairs(WorldCoins:GetChildren()) do
  906. if coin and coin:GetAttribute("Area") and coin:GetAttribute("Area") == area then
  907. table.insert(coinsInArea, coin)
  908. end
  909. end
  910.  
  911. return coinsInArea
  912. end
  913.  
  914.  
  915.  
  916. function SortCoinsByPriority(coins)
  917. local sortedCoins = {}
  918.  
  919.  
  920. CoinsTable = debug.getupvalue(getsenv(LocalPlayer.PlayerScripts.Scripts.Game.Coins).DestroyAllCoins, 1)
  921.  
  922. for _, coin in pairs(coins) do
  923. local coinMesh = coin:FindFirstChild("Coin")
  924. local mag = (HumanoidRootPart.Position - coinMesh.Position).magnitude
  925. if CoinsTable[coin.Name] and mag <= math.max(math.min(farmMaxDistance, Library.Settings.CoinGrabDistance), 10) and Library.WorldCmds.HasArea(coin:GetAttribute("Area")) then
  926. table.insert(sortedCoins, coin)
  927. end
  928. end
  929.  
  930.  
  931. table.sort(sortedCoins, function(coinA, coinB)
  932. local a = CoinsTable[coinA.Name]
  933. local b = CoinsTable[coinB.Name]
  934.  
  935. local APriority = GetCoinLowestPriority(a, b)
  936. local BPriority = GetCoinLowestPriority(b, a)
  937.  
  938. return APriority < BPriority
  939. end)
  940.  
  941.  
  942.  
  943. return sortedCoins
  944. end
  945.  
  946. function SortCoinsByPriorityFastMode(coins)
  947. local sortedCoins = {}
  948.  
  949.  
  950. for coinId, coin in pairs(coins) do
  951. coin.coinId = coinId
  952. local mag = (HumanoidRootPart.Position - coin.p).magnitude
  953. if mag <= math.max(math.min(farmMaxDistance, Library.Settings.CoinGrabDistance), 10) and Library.WorldCmds.HasArea(coin.a) then
  954. table.insert(sortedCoins, coin)
  955. end
  956. end
  957.  
  958. table.sort(sortedCoins, function(a, b)
  959. local APriority = GetCoinLowestPriority(a, b)
  960. local BPriority = GetCoinLowestPriority(b, a)
  961.  
  962. return APriority < BPriority
  963. end)
  964.  
  965.  
  966. return sortedCoins
  967. end
  968.  
  969. function GetCoinLowestPriority(mainCoin, coinToCompare)
  970. local coin = Library.Directory.Coins[mainCoin.n]
  971. local coinCompare = Library.Directory.Coins[coinToCompare.n]
  972.  
  973. local aMagnitude = (HumanoidRootPart.Position - mainCoin.p).magnitude
  974. local bMagnitude = (HumanoidRootPart.Position - coinToCompare.p).magnitude
  975.  
  976. local coinIsFruit = coin.breakSound == "fruit"
  977. local coinIsDiamond = coin.currencyType == "Diamonds"
  978. local coinIsEaster = coin.currencyType == "Easter Coins"
  979.  
  980. local coinHighestMultiplier = CalcMultiplier(mainCoin.b) > CalcMultiplier(coinToCompare.b)
  981.  
  982. local coinPriority = 9999999
  983.  
  984.  
  985. for priority, priorityName in ipairs(FarmFocusList) do
  986. if priorityName == "Fruits" and coinIsFruit then
  987. mainCoin.priority = priorityName
  988. coinPriority = priority
  989. break
  990. elseif priorityName == "Highest Multiplier" and coinHighestMultiplier then
  991. mainCoin.priority = priorityName
  992. coinPriority = priority
  993. break
  994. elseif priorityName == "Diamonds" and coinIsDiamond then
  995. mainCoin.priority = priorityName
  996. coinPriority = priority
  997. break
  998. elseif priorityName == "Lowest Life" and coin.health < coinCompare.health then
  999. mainCoin.priority = priorityName
  1000. coinPriority = priority
  1001. break
  1002. elseif priorityName == "Highest Life" and coin.health > coinCompare.health then
  1003. mainCoin.priority = priorityName
  1004. coinPriority = priority
  1005. break
  1006. elseif priorityName == "Nearest" and aMagnitude < bMagnitude then
  1007. mainCoin.priority = priorityName
  1008. coinPriority = priority
  1009. break
  1010. elseif priorityName == "Longest" and aMagnitude > bMagnitude then
  1011. mainCoin.priority = priorityName
  1012. coinPriority = priority
  1013. break
  1014. elseif priorityName == "Easter Coins" and coinIsEaster then
  1015. mainCoin.priority = priorityName
  1016. coinPriority = priority
  1017. break
  1018. end
  1019. end
  1020.  
  1021.  
  1022. return coinPriority
  1023. end
  1024.  
  1025. local petsCurrentlyFarming = {}
  1026.  
  1027.  
  1028. coroutine.wrap(function()
  1029. while true do
  1030. if enableAutoFarm and not ScriptIsCurrentlyBusy then
  1031. CoinsTable = debug.getupvalue(getsenv(LocalPlayer.PlayerScripts.Scripts.Game.Coins).DestroyAllCoins, 1)
  1032. RenderedPets = debug.getupvalue(getsenv(LocalPlayer.PlayerScripts.Scripts.Game.Pets).NetworkUpdate, 1)
  1033.  
  1034. if AutoFarm_FastMode then
  1035.  
  1036. local foundCoins = SortCoinsByPriorityFastMode(CoinsTable)
  1037. local equippedPets = Library.PetCmds.GetEquipped()
  1038. if equippedPets and #equippedPets > 0 and #foundCoins > 0 then
  1039. for _, pet in pairs(equippedPets) do
  1040. local selectedCoin = foundCoins[1]
  1041. task.spawn(function()
  1042. Library.Network.Invoke("Join Coin", selectedCoin.coinId, {pet.uid})
  1043. Library.Network.Fire("Farm Coin", selectedCoin.coinId, pet.uid)
  1044.  
  1045. end)
  1046.  
  1047. table.remove(foundCoins, 1)
  1048. task.wait(AutoFarm_FarmSpeed)
  1049. end
  1050. end
  1051. else
  1052. local equippedPets = Library.PetCmds.GetEquipped()
  1053. local foundCoins = {}
  1054.  
  1055. for _, ch in ipairs(SortCoinsByPriority(WorldCoins:GetChildren())) do
  1056. local containsMyPet = false
  1057. local coin = CoinsTable[ch.Name]
  1058. local coinMesh = ch:FindFirstChild("Coin")
  1059. local mag = (HumanoidRootPart.Position - coinMesh.Position).magnitude
  1060.  
  1061. for _, pet in pairs(equippedPets) do
  1062. if coin and coin.pets and table.find(coin.pets, pet.uid) then
  1063. containsMyPet = true
  1064. break
  1065. end
  1066. end
  1067.  
  1068. if not containsMyPet and mag <= math.max(math.min(farmMaxDistance, Library.Settings.CoinGrabDistance), 10) and Library.WorldCmds.HasArea(ch:GetAttribute("Area")) then
  1069. table.insert(foundCoins, ch)
  1070. end
  1071. end
  1072.  
  1073.  
  1074. for i, pet in pairs(RenderedPets) do
  1075. if ScriptIsCurrentlyBusy or not enableAutoFarm or #foundCoins <= 0 then break end
  1076. if pet.spawned.owner == LocalPlayer and not pet.farming then
  1077. local coin = foundCoins[1]
  1078. if coin then
  1079. if not coin:FindFirstChild("Pets") then
  1080. local petsFolder = Instance.new("Folder")
  1081. petsFolder.Name = "Pets"
  1082. petsFolder.Parent = coin
  1083. end
  1084.  
  1085. -- Legit Mode
  1086. Library.Signal.Fire("Select Coin", coin, pet)
  1087.  
  1088. table.remove(foundCoins, 1)
  1089. wait(AutoFarm_FarmSpeed)
  1090. end
  1091.  
  1092. end
  1093.  
  1094. end
  1095. end
  1096. end
  1097. wait(0.1)
  1098. end
  1099. end)()
  1100.  
  1101.  
  1102.  
  1103. function IsEggUnlocked(eggId)
  1104. local egg = Library.Directory.Eggs[eggId]
  1105. local saveData = Library.Save.Get()
  1106. if egg.areaRequired then
  1107. if not Library.WorldCmds.HasArea(egg.area) then
  1108. return false
  1109. end
  1110. end
  1111.  
  1112. if egg.eggRequired ~= "" then
  1113. if egg.eggRequired ~= eggId then
  1114. if not IsEggUnlocked(egg.eggRequired) then
  1115. return false
  1116. end
  1117. end
  1118. end
  1119.  
  1120. if egg.eggRequiredOpenAmount > 0 then
  1121. if egg.eggRequired ~= "" then
  1122. local eggsHatched = (IsHardcore and saveData.Hardcore.EggsOpened or saveData.EggsOpened)[egg.eggRequired]
  1123. if eggsHatched then
  1124. if eggsHatched < egg.eggRequiredOpenAmount then
  1125. return false
  1126. end
  1127. else
  1128. return false
  1129. end
  1130. end
  1131. end
  1132.  
  1133. if eggId == "Dominus Egg" then
  1134. if IsHardcore and not saveData.Hardcore.OwnsDominusGate then return false end
  1135. if not IsHardcore and not saveData.OwnsDominusGate then return false end
  1136. elseif eggId == "Hacker Egg" or eggId == "Hacker Golden Egg" then
  1137. if IsHardcore and not saveData.Hardcore.OwnsHackerGate then return false end
  1138. if not IsHardcore and not saveData.OwnsHackerGate then return false end
  1139. end
  1140.  
  1141. return true
  1142. end
  1143.  
  1144. function HatchEgg(eggId, tripleHatch, octupleHatch, teleportToEgg)
  1145. if ScriptIsCurrentlyBusy then return false, "Script is currently busy!" end
  1146.  
  1147. if not eggId or eggId == "None" then return false, "No egg provided!" end
  1148. local eggToHatch = Library.Directory.Eggs[eggId]
  1149. if not eggToHatch then return false, "Didn't found this egg!" end
  1150.  
  1151. if tripleHatch == nil then tripleHatch = false end
  1152. if octupleHatch == nil then octupleHatch = false end
  1153.  
  1154. if not eggToHatch.hatchable or eggToHatch.disabled then return false, "This is egg is not available!" end
  1155. if not IsEggUnlocked(eggId) then return false, "This egg is not unlocked yet!" end
  1156.  
  1157. local eggArea = Library.Directory.Areas[eggToHatch.area]
  1158. if eggArea then
  1159. if teleportToEgg and Library.WorldCmds.Get() ~= eggArea.world then
  1160. Library.WorldCmds.Load(eggArea.world)
  1161. wait(0.25)
  1162. elseif not teleportToEgg and Library.WorldCmds.Get() ~= eggArea.world then return false, "You're not in the right world!" end
  1163.  
  1164. local mapEgg = nil
  1165.  
  1166. for i,v in pairs(Library.WorldCmds.GetAllEggs()) do
  1167. if v:GetAttribute("ID") and v:GetAttribute("ID") == eggId then
  1168. mapEgg = v
  1169. break
  1170. end
  1171. end
  1172.  
  1173. if not mapEgg then return false, "Didn't found the egg in map!" end
  1174.  
  1175. local isNearEgg = Library.LocalPlayer:DistanceFromCharacter(mapEgg.PrimaryPart.CFrame.p) <= 30
  1176.  
  1177. if teleportToEgg and not isNearEgg then
  1178. HumanoidRootPart.CFrame = CFrame.new(mapEgg.PrimaryPart.CFrame.p) + (mapEgg.PrimaryPart.CFrame.RightVector * 10)
  1179. wait(0.25)
  1180. elseif not teleportToEgg and not isNearEgg then return false, "You're too far from the egg!" end
  1181. end
  1182.  
  1183. return Library.Network.Invoke("Buy Egg", eggId, tripleHatch, octupleHatch)
  1184. end
  1185.  
  1186. -- local easterEventTab = Window:CreateTab("Easter Event", "13075572975", true)
  1187. -- local easterEventSection = easterEventTab:CreateSection("Easter Event", true)
  1188. -- easterEventTab:CreateButton({
  1189. -- Name = "Teleport to Easter Isle",
  1190. -- Callback = function()
  1191. -- if Library.WorldCmds.Get() ~= "Spawn" then
  1192. -- if not Library.WorldCmds.Load("Spawn") then return end
  1193. -- end
  1194. -- wait(0.25)
  1195.  
  1196. -- local areaTeleport = Library.WorldCmds.GetMap().Teleports:FindFirstChild("Easter")
  1197. -- if areaTeleport then
  1198. -- Character:PivotTo(areaTeleport.CFrame + areaTeleport.CFrame.UpVector * (Humanoid.HipHeight + HumanoidRootPart.Size.Y / 2))
  1199. -- end
  1200. -- end
  1201. -- })
  1202.  
  1203. -- local Easter_AutoEggHunt = false
  1204. -- local isEggHuntHappening = false
  1205. -- local eggHuntTimeSeed = 0
  1206. -- local lastEggHuntSeed = 0
  1207.  
  1208. -- task.spawn(function()
  1209. -- task.wait(1)
  1210. -- local checkEggHuntSeed = Library.Network.Invoke("Easter Egg Hunt: Get Time Seed")
  1211. -- if checkEggHuntSeed and checkEggHuntSeed and checkEggHuntSeed > 0 and os.time() >= checkEggHuntSeed and os.time() < checkEggHuntSeed + (60 * 60) then
  1212. -- isEggHuntHappening = true
  1213. -- eggHuntTimeSeed = checkEggHuntSeed
  1214. -- lastEggHuntSeed = 0
  1215. -- end
  1216. -- end)
  1217.  
  1218.  
  1219. -- local easterEventAutoEggHunt = easterEventTab:CreateToggle({
  1220. -- Name = "Auto Egg Hunt",
  1221. -- CurrentValue = false,
  1222. -- Flag = "Easter_AutoEggHunt",
  1223. -- Callback = function(value)
  1224. -- Easter_AutoEggHunt = value
  1225. -- lastEggHuntSeed = 0
  1226.  
  1227. -- if not value then return end
  1228.  
  1229. -- local checkEggHuntSeed = Library.Network.Invoke("Easter Egg Hunt: Get Time Seed")
  1230. -- if checkEggHuntSeed and checkEggHuntSeed and checkEggHuntSeed > 0 and os.time() >= checkEggHuntSeed and os.time() < checkEggHuntSeed + (60 * 60) then
  1231. -- isEggHuntHappening = true
  1232. -- eggHuntTimeSeed = checkEggHuntSeed
  1233. -- lastEggHuntSeed = 0
  1234. -- end
  1235.  
  1236. -- wait()
  1237. -- task.spawn(function()
  1238. -- while Easter_AutoEggHunt do
  1239. -- local saveData = Library.Save.Get()
  1240. -- if isEggHuntHappening and eggHuntTimeSeed > 0 and lastEggHuntSeed == 0 then
  1241. -- if not (saveData and saveData.Easter2023.FoundEggs and saveData.Easter2023.FoundEggs[tostring(eggHuntTimeSeed)] and #saveData.Easter2023.FoundEggs[tostring(eggHuntTimeSeed)] >= 100) then
  1242. -- if ScriptIsCurrentlyBusy then
  1243. -- while ScriptIsCurrentlyBusy do wait() end
  1244. -- ScriptIsCurrentlyBusy = true
  1245. -- wait(1)
  1246. -- end
  1247.  
  1248. -- ScriptIsCurrentlyBusy = true
  1249. -- CurrentWorld = Library.WorldCmds.Get()
  1250. -- CurrentPosition = HumanoidRootPart.CFrame
  1251.  
  1252. -- for i, world in ipairs(AllGameWorlds) do
  1253. -- if not Easter_AutoEggHunt then break end
  1254. -- if not world.requiredArea or Library.WorldCmds.HasArea(world.requiredArea) then
  1255.  
  1256. -- if Library.WorldCmds.Get() ~= world.name then
  1257. -- Library.WorldCmds.Load(world.name)
  1258. -- end
  1259.  
  1260. -- for i,v in pairs(Library.WorldCmds.GetMap():WaitForChild("EasterEggs"):GetChildren()) do
  1261. -- if not Easter_AutoEggHunt then break end
  1262. -- if v:GetAttribute("Enabled") then
  1263. -- task.spawn(function()
  1264. -- local success, errorMessage = Library.Network.Invoke("Easter Egg Hunt: Claim", v.Name, (v:GetAttribute("TextureIDX")))
  1265. -- if not success then print(errorMessage) end
  1266. -- end)
  1267. -- wait(0.05)
  1268. -- end
  1269.  
  1270. -- end
  1271. -- end
  1272. -- end
  1273.  
  1274. -- wait(5)
  1275. -- TeleportBack()
  1276. -- wait(1)
  1277. -- ScriptIsCurrentlyBusy = false
  1278. -- end
  1279. -- lastEggHuntSeed = eggHuntTimeSeed
  1280. -- end
  1281.  
  1282. -- wait(5)
  1283. -- end
  1284. -- end)
  1285. -- end
  1286. -- })
  1287.  
  1288.  
  1289. -- Library.Network.Fired("Easter Egg Hunt: End"):Connect(function()
  1290. -- isEggHuntHappening = false
  1291. -- eggHuntTimeSeed = 0
  1292. -- lastEggHuntSeed = 0
  1293. -- end)
  1294.  
  1295. -- Library.Network.Fired("Easter Egg Hunt: Start"):Connect(function(eggHuntData)
  1296. -- isEggHuntHappening = true
  1297. -- eggHuntTimeSeed = Library.Network.Invoke("Easter Egg Hunt: Get Time Seed")
  1298. -- lastEggHuntSeed = 0
  1299. -- end)
  1300.  
  1301.  
  1302.  
  1303.  
  1304. local eggTab = Window:CreateTab("Eggs", "13075637275", true)
  1305. local hatchingSection = eggTab:CreateSection("Egg Hatching", false)
  1306. local eggInfo = eggTab:CreateParagraph({Title = "Information", Content = "Buy some egg in-game and it will be automatically selected!\nSelected Egg: %s\nMode: %s\nQuantity Hatched: %s\nQuantity Remaining: %s\n25x Insane Luck: %s\n\n\n\naaa"}, hatchingSection)
  1307.  
  1308. local LastOpenEggId = "None"
  1309. AddCustomFlag("CurrentEgg", "None", function(newValue)
  1310. LastOpenEggId = newValue
  1311. end)
  1312.  
  1313. local LastOpenEggData = nil
  1314. local LastHatchSetting = "Normal"
  1315. AddCustomFlag("CurrentHatchSettings", "Normal", function(newValue)
  1316. LastHatchSetting = newValue
  1317. end)
  1318.  
  1319. local EnableAutoHatch = false
  1320. eggTab:CreateToggle({
  1321. Name = "Auto Hatch",
  1322. Flag = "AutoHatch_Enabled",
  1323. SectionParent = hatchingSection,
  1324. Callback = function(Value)
  1325. EnableAutoHatch = Value
  1326. if EnableAutoHatch then
  1327. coroutine.wrap(function()
  1328. while EnableAutoHatch do
  1329. wait(math.random(3, 3.1))
  1330. if not EnableAutoHatch then break end
  1331. local tripleHatch = false
  1332. local octupleHatch = false
  1333. if LastHatchSetting == "Triple" then tripleHatch = true end
  1334. if LastHatchSetting == "Octuple" then octupleHatch = true end
  1335. --print("Trying to hatch: ", LastOpenEggId, tripleHatch, octupleHatch)
  1336. local successHatch, errorHatch = HatchEgg(LastOpenEggId, tripleHatch, octupleHatch, true)
  1337. if not successHatch then print(errorHatch or "Opss, failed to hatch!") end
  1338. end
  1339. end)()
  1340. end
  1341. end
  1342. })
  1343.  
  1344. local Original_OpenEgg = nil
  1345. eggTab:CreateToggle({
  1346. Name = "Skip Egg Animation",
  1347. Flag = "AutoFarm_SkipEggAnimation",
  1348. SectionParent = hatchingSection,
  1349. Callback = function(Value)
  1350. if Value then SkipEggAnimation() else RestoreEggAnimation() end
  1351. end
  1352. })
  1353.  
  1354.  
  1355. local OpenEggsScript = getsenv(LocalPlayer.PlayerScripts.Scripts.Game:WaitForChild("Open Eggs", 10))
  1356.  
  1357. function SkipEggAnimation()
  1358. if not Original_OpenEgg then
  1359. Original_OpenEgg = OpenEggsScript.OpenEgg
  1360. end
  1361.  
  1362. OpenEggsScript.OpenEgg = function()
  1363. return true
  1364. end
  1365. end
  1366.  
  1367. function RestoreEggAnimation()
  1368. if not Original_OpenEgg then return end
  1369. OpenEggsScript.OpenEgg = Original_OpenEgg
  1370. end
  1371.  
  1372. function UpdateEggInfo()
  1373. local playerData = Library.Save.Get()
  1374. local playerEggsOpened = playerData["EggsOpened"]
  1375. local serverBoosts = Library.ServerBoosts.GetActiveBoosts()
  1376.  
  1377. if eggInfo then
  1378. local selectedEgg = LastOpenEggId or "None"
  1379. local selectedSetting = LastHatchSetting or "Normal"
  1380. local eggsOpened = Library.Functions.Commas(playerEggsOpened and playerEggsOpened[LastOpenEggId] and playerEggsOpened[LastOpenEggId] or 0)
  1381. local eggsRemaining = Library.Functions.Commas(Library.Directory.Eggs[selectedEgg] and math.floor(playerData[Library.Directory.Eggs[selectedEgg].currency] / Library.Directory.Eggs[selectedEgg].cost) > 0 and math.floor(playerData[Library.Directory.Eggs[selectedEgg].currency] / Library.Directory.Eggs[selectedEgg].cost) or 0)
  1382. local insaneLucky = serverBoosts and serverBoosts["Insane Luck"] and tostring(serverBoosts["Insane Luck"].totalTimeLeft) .. "s" or "Inactive"
  1383. eggInfo:Set({Title = "Information", Content = string.format("Buy some egg in-game and it will be automatically selected!\n\n<b>Selected Egg:</b> %s\n<b>Mode:</b> %s\n<b>Quantity Hatched:</b> %s\n<b>Quantity Remaining:</b> %s\n<b>25x Insane Luck:</b> %s", selectedEgg, selectedSetting, eggsOpened, eggsRemaining, insaneLucky)})
  1384. end
  1385. end
  1386.  
  1387. task.spawn(function()
  1388. while true do
  1389. UpdateEggInfo()
  1390. task.wait()
  1391. end
  1392. end)
  1393.  
  1394. local automationTab = Window:CreateTab("Automation", "13075622619", true)
  1395.  
  1396. local automaticFunctionsSection = automationTab:CreateSection("Automatic Functions", false)
  1397. local enableAutoDaycare = false
  1398. local autodaycareButton = automationTab:CreateToggle({
  1399. Name = "Auto Daycare",
  1400. CurrentValue = false,
  1401. Flag = "Automation_AutoDaycare",
  1402. SectionParent = automaticFunctionsSection,
  1403. Callback = function(Value)
  1404. enableAutoDaycare = Value
  1405.  
  1406. if Value then
  1407. CreateReminder()
  1408. end
  1409. end
  1410. })
  1411.  
  1412. local Automations_AutoGameComplete = false
  1413. local autoCompleteGameToggle = automationTab:CreateToggle({
  1414. Name = "Auto Complete Game",
  1415. Flag = "Automation_AutoCompleteGame",
  1416. CurrentValue = false,
  1417. SectionParent = automaticFunctionsSection,
  1418. Callback = function(Value)
  1419.  
  1420. if Value then
  1421. local currentAreaName, nextAreaName = GetCurrentAndNextArea()
  1422. if nextAreaName ~= "COMPLETED" then
  1423. local areaToTeleport = Library.Directory.Areas[currentAreaName]
  1424. if areaToTeleport and areaToTeleport.world then
  1425. if Library.WorldCmds.Get() ~= areaToTeleport.world then
  1426. Library.WorldCmds.Load(areaToTeleport.world)
  1427. end
  1428. wait(0.25)
  1429.  
  1430. local areaTeleport = Library.WorldCmds.GetMap().Teleports:FindFirstChild(currentAreaName)
  1431. if areaTeleport then
  1432. Library.Signal.Fire("Teleporting")
  1433. task.wait(0.25)
  1434. Character:PivotTo(areaTeleport.CFrame + areaTeleport.CFrame.UpVector * (Humanoid.HipHeight + HumanoidRootPart.Size.Y / 2))
  1435. Library.Network.Fire("Performed Teleport", currentAreaName)
  1436. task.wait(0.25)
  1437. end
  1438. end
  1439. else
  1440. Value = false
  1441. Rayfield.Flags["Automation_AutoCompleteGame"]:Set(false)
  1442. end
  1443. -- CHECK FOR CURRENT AREA AND TELEPORT TO IT
  1444. end
  1445.  
  1446. Automations_AutoGameComplete = Value
  1447.  
  1448. end
  1449. })
  1450. local _, nextAreaCheck = GetCurrentAndNextArea()
  1451. if nextAreaCheck == "COMPLETED" then
  1452. autoCompleteGameToggle:Lock("No areas to unlock! 🎉", true)
  1453. end
  1454.  
  1455. local bankIndexSection = automationTab:CreateSection("Bank Index", false, false, "13080063246")
  1456. automationTab:CreateParagraph({ Title = "What is this?", Content = "Some people <font color=\"#2B699F\">store pets in a bank to complete the pet collection</font> on alt accounts.\n<b>This feature should help on that process, it will automatically do:</b>\n- <font color=\"#2B699F\"><b>Check non-indexed pets on current account</b></font>\n- <font color=\"#2B699F\"><b>Take pets from the bank</b></font>\n- <font color=\"#2B699F\"><b>Put back on the bank after indexed</b></font>" }, bankIndexSection)
  1457.  
  1458. local BankIndex_Debounce = false
  1459. local BankIndex_InProgress = false
  1460. local BankIndex_OwnerUsername = ""
  1461.  
  1462. local Input = automationTab:CreateInput({
  1463. Name = "Bank Owner",
  1464. Info = "Owner of the bank", -- Speaks for itself, Remove if none.
  1465. PlaceholderText = "CoolUsername69",
  1466. Flag = "BankIndex_OwnerUsername",
  1467. SectionParent = bankIndexSection,
  1468. OnEnter = false, -- Will callback only if the user pressed ENTER while the box is focused.
  1469. RemoveTextAfterFocusLost = false,
  1470. Callback = function(Text)
  1471. BankIndex_OwnerUsername = Text
  1472. end,
  1473. })
  1474.  
  1475. local bankIndexInfo = automationTab:CreateParagraph({
  1476. Title = "Idling",
  1477. Content = "Not doing anything yet..."
  1478. }, bankIndexSection)
  1479.  
  1480. local startBankIndex = nil
  1481.  
  1482. function BankMessage(message)
  1483. if not startBankIndex then return end
  1484. coroutine.wrap(function()
  1485. while true do
  1486. wait()
  1487. startBankIndex:Set(nil, message)
  1488. break
  1489. end
  1490. end)()
  1491. end
  1492.  
  1493. function BankError(errorMessage)
  1494. pcall(function()
  1495. bankIndexInfo:Set({
  1496. Title = "Idling",
  1497. Content = "Not doing anything yet..."
  1498. })
  1499. end)
  1500. BankMessage(errorMessage)
  1501. print("Error on Bank Index: " .. errorMessage)
  1502. wait(3)
  1503. BankMessage("")
  1504. end
  1505.  
  1506. startBankIndex = automationTab:CreateButton({
  1507. Name = "Start Indexing",
  1508. CurrentValue = false,
  1509. Interact = "",
  1510. SectionParent = bankIndexSection,
  1511. Callback = function(Value)
  1512.  
  1513. if BankIndex_Debounce then return end
  1514.  
  1515. if not BankIndex_InProgress then
  1516. BankIndex_Debounce = true
  1517. coroutine.wrap(function()
  1518. wait(0.3)
  1519. BankIndex_Debounce = false
  1520. end)()
  1521. end
  1522.  
  1523. -- Start bank functions
  1524. if BankIndex_InProgress then
  1525. -- Cancel process
  1526. BankIndex_Debounce = true
  1527. BankIndex_InProgress = false
  1528. BankMessage(nil, "")
  1529. coroutine.wrap(function()
  1530. while true do
  1531. wait()
  1532. startBankIndex:Set("Waiting deposit to stop...", nil)
  1533. break
  1534. end
  1535. end)()
  1536. else
  1537. -- Start process
  1538. local SaveData = Library.Save.Get()
  1539. if not SaveData or not SaveData.Collection then
  1540. BankError("Failed to get data!")
  1541. return
  1542. end
  1543.  
  1544. if Library.WorldCmds.Get() ~= "Spawn" then
  1545. if not Library.WorldCmds.Load("Spawn") then return end
  1546. wait(1)
  1547. end
  1548.  
  1549. HumanoidRootPart.CFrame = Library.WorldCmds.GetMap().Interactive.Bank.Pad.CFrame + Vector3.new(0, 3, 0)
  1550. HumanoidRootPart.CFrame = HumanoidRootPart.CFrame + (HumanoidRootPart.CFrame.LookVector * 15)
  1551.  
  1552. wait(0.5)
  1553.  
  1554. local BankUID = nil
  1555.  
  1556. BankMessage(nil, "Getting UserID")
  1557. local success, result = pcall(function() return Players:GetUserIdFromNameAsync(BankIndex_OwnerUsername) end)
  1558. if not success then
  1559. BankError("User not found!")
  1560. print(result)
  1561. return
  1562. end
  1563.  
  1564. ownerId = result
  1565. if not ownerId or not tonumber(ownerId) then
  1566. BankError("Can't get UserID")
  1567. return
  1568. end
  1569.  
  1570. local myBanks = Library.Network.Invoke("Get My Banks")
  1571. if not myBanks then
  1572. BankError("Bank is on cooldown!")
  1573. return
  1574. end
  1575.  
  1576. for _, bank in pairs(myBanks) do
  1577. if bank.Owner == tonumber(ownerId) then
  1578. BankUID = bank.BUID
  1579. break
  1580. end
  1581. end
  1582.  
  1583.  
  1584. if not BankUID then BankError("Bank was not found!") return end
  1585.  
  1586. -- Get missing collection pets
  1587. local allCollectablePets = Library.Shared.GetAllCollectablePets()
  1588. local remainingPets = {}
  1589.  
  1590. for i, pet in pairs(allCollectablePets) do
  1591. local petId = pet.petId
  1592. local isGolden = pet.isGolden
  1593. local isRainbow = pet.isRainbow
  1594. local isDarkMatter = pet.isDarkMatter
  1595.  
  1596. local petType = 1
  1597. if isGolden then
  1598. petType = 2
  1599. elseif isRainbow then
  1600. petType = 3
  1601. elseif isDarkMatter then
  1602. petType = 4
  1603. end
  1604.  
  1605. local isUnlocked = Library.Functions.SearchArray(SaveData.Collection, tostring(petId) .. "-" .. tostring(petType))
  1606. if not isUnlocked then
  1607. remainingPets[petId] = true
  1608. end
  1609. end
  1610.  
  1611.  
  1612. local Bank = Library.Network.Invoke("Get Bank", BankUID)
  1613. if not Bank then BankError("Bank was not found!") return end
  1614.  
  1615. local BankPets = Bank.Storage.Pets
  1616.  
  1617.  
  1618. local petsAvailableOnBank = {}
  1619. for _, pet in pairs(BankPets) do
  1620. local petId = pet.id
  1621. local isGolden = pet.g
  1622. local isRainbow = pet.r
  1623. local isDarkMatter = pet.dm
  1624.  
  1625. local petType = 1
  1626. if isGolden then petType = 2
  1627. elseif isRainbow then petType = 3
  1628. elseif isDarkMatter then petType = 4 end
  1629.  
  1630. local isUnlocked = Library.Functions.SearchArray(SaveData.Collection, tostring(petId) .. "-" .. tostring(petType))
  1631.  
  1632. local petData = Library.Directory.Pets[petId]
  1633. if petData and (petData.titanic or petData.huge or petData.rarity == "Exclusive" or petData.rarity == "Event") then petType = 5 end -- Huges/Exclusives/Event don't need to be indexed more than 1 time
  1634.  
  1635. local petIdentifer = tostring(petId) .. "-" .. tostring(petType)
  1636. -- Pet is not unlocked and not on our table, put they on list!
  1637. if remainingPets[petId] and not petsAvailableOnBank[petIdentifer] and not isUnlocked then petsAvailableOnBank[petIdentifer] = pet end
  1638. end
  1639.  
  1640.  
  1641. local function UpdateInfo()
  1642. local petsAvailableOnBankCount = 0
  1643. for _, pet in pairs(petsAvailableOnBank) do
  1644. if pet then
  1645. petsAvailableOnBankCount = petsAvailableOnBankCount + 1
  1646. end
  1647. end
  1648.  
  1649. bankIndexInfo:SetContent(string.format("You have <b>%s</b> of %s unlockable pets\n", tostring(#SaveData.Collection), tostring(#allCollectablePets)) ..
  1650. string.format("This bank have %s pets in total\n", tostring(#BankPets)) ..
  1651. string.format("This bank have <b>%s</b> of %s pets that you need to complete your collection", tostring(petsAvailableOnBankCount), tostring(#allCollectablePets - #SaveData.Collection)))
  1652.  
  1653. end
  1654. UpdateInfo()
  1655.  
  1656. BankIndex_InProgress = true
  1657.  
  1658. coroutine.wrap(function()
  1659. while true do
  1660. wait()
  1661. startBankIndex:Set("Stop Indexing", nil)
  1662. break
  1663. end
  1664. end)()
  1665.  
  1666. wait(1)
  1667.  
  1668. coroutine.wrap(function()
  1669. local petsToWithdraw = {}
  1670. local failedToDeposit = false
  1671. while BankIndex_InProgress do
  1672.  
  1673. UpdateInfo()
  1674. if not petsToWithdraw or #petsToWithdraw < 50 then
  1675. for petIdentifer, pet in pairs(petsAvailableOnBank) do
  1676. if pet and pet.uid and #petsToWithdraw < 50 then
  1677. table.insert(petsToWithdraw, pet.uid)
  1678. petsAvailableOnBank[petIdentifer] = nil
  1679. end
  1680.  
  1681. if #petsToWithdraw >= 50 then break end
  1682. end
  1683. end
  1684.  
  1685. UpdateInfo()
  1686. if petsToWithdraw and #petsToWithdraw > 0 then
  1687. bankIndexInfo:SetTitle(string.format("Withdrawing %s pets...", tostring(#petsToWithdraw)))
  1688. wait(0.5)
  1689.  
  1690. local oldCollectionCount = 0 + #SaveData.Collection
  1691. local expectedCollectionCount = oldCollectionCount + #petsToWithdraw
  1692.  
  1693. local withdrawSuccess, withdrawMessage = Library.Network.Invoke("Bank Withdraw", BankUID, petsToWithdraw, 0)
  1694. if withdrawSuccess then
  1695. UpdateInfo()
  1696. bankIndexInfo:SetTitle(string.format("Waiting for %s pets to index...", tostring(#petsToWithdraw)))
  1697. wait(5)
  1698.  
  1699. local cTick = tick()
  1700. repeat UpdateInfo() wait() until #SaveData.Collection > oldCollectionCount or not BankIndex_InProgress or tick() - cTick > 15
  1701. bankIndexInfo:SetTitle(string.format("Depositing %s pets...", tostring(#petsToWithdraw)))
  1702.  
  1703. UpdateInfo()
  1704. local depositsAttempts = 0
  1705.  
  1706.  
  1707. local function TryToDeposit()
  1708. local depositSuccess, depositMessage = Library.Network.Invoke("Bank Deposit", BankUID, petsToWithdraw, 0)
  1709. if not depositSuccess then
  1710. if depositsAttempts >= 5 then
  1711. failedToDeposit = true
  1712. return
  1713. end
  1714. depositsAttempts = depositsAttempts + 1
  1715. wait(5)
  1716. TryToDeposit()
  1717. end
  1718. end
  1719.  
  1720. TryToDeposit()
  1721.  
  1722. if failedToDeposit then
  1723. bankIndexInfo:SetTitle("Oopps... Aborting process!")
  1724. bankIndexInfo:SetContent(string.format("Damn! <b>Failed to deposit</b> after <b>5</b> attempts, <font color=\"#FF0000\">process has been canceled</font>!\nFailed to deposit: %s pets!", tostring(#petsToWithdraw)))
  1725. break
  1726. else
  1727. -- CLEAR THE WITHDRAW TABLE
  1728. petsToWithdraw = {}
  1729. end
  1730. else
  1731. print(withdrawMessage)
  1732. end
  1733. else break end
  1734. wait(10)
  1735. end
  1736.  
  1737. BankIndex_InProgress = false
  1738. BankIndex_Debounce = false
  1739. UpdateInfo()
  1740.  
  1741. coroutine.wrap(function()
  1742. while true do
  1743. wait()
  1744. startBankIndex:Set("Start Indexing", nil)
  1745. break
  1746. end
  1747. end)()
  1748.  
  1749. if not failedToDeposit then
  1750. bankIndexInfo:Set({
  1751. Title = "Idling",
  1752. Content = "Not doing anything yet..."
  1753. })
  1754. end
  1755.  
  1756. BankMessage(nil, "")
  1757. end)()
  1758. end
  1759. end
  1760. })
  1761.  
  1762. local CompleteCollection_NormalEggs = true
  1763. local CompleteCollection_GoldenEggs = true
  1764. local CompleteCollection_MakeRainbows = false
  1765. local CompleteCollection_MakeDarkMatter = false
  1766.  
  1767. function GetNextMissingPet()
  1768. local SaveData = Library.Save.Get()
  1769. if not SaveData then return nil end
  1770.  
  1771. local allCollectablePets = Library.Shared.GetAllCollectablePets()
  1772. local remainingPets = {}
  1773.  
  1774. for i, pet in pairs(allCollectablePets) do
  1775. local petId = pet.petId
  1776. local petData = Library.Directory.Pets[petId]
  1777. local isGolden = pet.isGolden
  1778. local isRainbow = pet.isRainbow
  1779. local isDarkMatter = pet.isDarkMatter
  1780.  
  1781. local petType = 1
  1782. if isGolden then
  1783. petType = 2
  1784. elseif isRainbow then
  1785. petType = 3
  1786. elseif isDarkMatter then
  1787. petType = 4
  1788. end
  1789.  
  1790.  
  1791. local isUnlocked = Library.Functions.SearchArray(SaveData.Collection, tostring(petId) .. "-" .. tostring(petType))
  1792. if petData and not (petData.titanic or petData.huge or petData.rarity == "Exclusive" or petData.rarity == "Event") and not isUnlocked then
  1793. -- remainingPets[petId] = petType
  1794. table.insert(remainingPets, {petId, petType})
  1795. end
  1796. end
  1797.  
  1798. table.sort(remainingPets, function(a, b)
  1799. local petDataA = Library.Directory.Pets[a[1]]
  1800. local petDataB = Library.Directory.Pets[b[1]]
  1801.  
  1802. local petTypeA = a[2]
  1803. local petTypeB = b[2]
  1804.  
  1805. if a == b then
  1806. return petTypeA < petTypeB
  1807. end
  1808.  
  1809. return a[1] < b[1]
  1810. end)
  1811.  
  1812. for i, v in ipairs(remainingPets) do return v end
  1813. end
  1814.  
  1815. function GetBestEggForPet(petId)
  1816. local allEggs = Library.Directory.Eggs
  1817. local eggsWithPet = {}
  1818. for eggId, v in pairs(allEggs) do
  1819. if v and v.drops and typeof(v.drops) == "table" then
  1820. for _, drop in pairs(v.drops) do
  1821. local petDropId = drop[1]
  1822. if petDropId == tostring(petId) then
  1823. table.insert(eggsWithPet, {eggId, drop[2]})
  1824. end
  1825. end
  1826. end
  1827. end
  1828.  
  1829. table.sort(eggsWithPet, function(a, b)
  1830. local chanceA = eggsWithPet[a][2]
  1831. local chanceB = eggsWithPet[b][2]
  1832.  
  1833. return chanceA > chanceB
  1834. end)
  1835.  
  1836. for i, v in ipairs(eggsWithPet) do
  1837. return v[1]
  1838. end
  1839. return nil
  1840. end
  1841.  
  1842. local completeCollectionSection = automationTab:CreateSection("Auto Pet Collection", false, true)
  1843. local completeCollectionStatus = automationTab:CreateParagraph({Title = "Status", Content = "Waiting to start"}, completeCollectionSection)
  1844.  
  1845. local completeCollectionNormalEggs = automationTab:CreateToggle({
  1846. Name = "Normal Eggs",
  1847. SectionParent = completeCollectionSection,
  1848. CurrentValue = true,
  1849. Flag = "CompleteCollection_NormalEggs",
  1850. Callback = function(value)
  1851. CompleteCollection_NormalEggs = value
  1852.  
  1853. coroutine.wrap(function()
  1854. local currentPet, currentPetType = unpack(GetNextMissingPet())
  1855. local currentEgg = GetBestEggForPet(currentPet)
  1856. completeCollectionStatus:SetContent("Pet: " .. Library.Directory.Pets[currentPet].name .. "\nType: " .. currentPetType .. "\nEgg: " .. currentEgg)
  1857.  
  1858.  
  1859. while task.wait(3) do
  1860.  
  1861. end
  1862. end)()
  1863. end
  1864. })
  1865.  
  1866.  
  1867. local completeCollectionGolldenEggs = automationTab:CreateToggle({
  1868. Name = "Golden Eggs",
  1869. SectionParent = completeCollectionSection,
  1870. CurrentValue = true,
  1871. Flag = "CompleteCollection_GoldenEggs",
  1872. Callback = function(value)
  1873. CompleteCollection_GoldenEggs = value
  1874. end
  1875. })
  1876.  
  1877. local completeCollectionMakeRainbows = automationTab:CreateToggle({
  1878. Name = "Make Rainbows",
  1879. SectionParent = completeCollectionSection,
  1880. CurrentValue = false,
  1881. Flag = "CompleteCollection_MakeRainbows",
  1882. Callback = function(value)
  1883. CompleteCollection_MakeRainbows = value
  1884. end
  1885. })
  1886.  
  1887. local completeCollectionMakeDarkMatter = automationTab:CreateToggle({
  1888. Name = "Make Dark Matter",
  1889. SectionParent = completeCollectionSection,
  1890. CurrentValue = false,
  1891. Flag = "CompleteCollection_MakeDarkMatter",
  1892. Callback = function(value)
  1893. CompleteCollection_MakeDarkMatter = value
  1894. end
  1895. })
  1896.  
  1897.  
  1898. -- SETTINGS
  1899. local AUTODAYCARE_OTHER_GAMEMODES = false -- CHANGE THIS TO TRUE IF YOU WANT TO AUTO-COLLECT/ENROLL BOTH NORMAL AND HARDCORE GAMEMODES
  1900. local TRY_TO_TELEPORT_SAME_SERVER = true -- If auto-daycare is enabled for both gamemodes, this option will TRY teleport you back to the same server that you were before
  1901.  
  1902.  
  1903.  
  1904. local DAYCARE_WORLD = "Spawn"
  1905. local DAYCARE_POSITION = Vector3.new(35, 110, 40)
  1906. local PetsToDaycare = {}
  1907.  
  1908. local DaycareGUI = Library.GUI.Daycare;
  1909.  
  1910. local DISCORD_EMOTES = {
  1911. ["Diamonds"] = "<:e:1062469796341497887>",
  1912. ["Triple Coins"] = "<:e:1082130777355079800>",
  1913. ["Triple Damage"] = "<:e:1082130816261443674>",
  1914. ["Super Lucky"] = "<:e:1082130793880621167>",
  1915. ["Ultra Lucky"] = "<:e:1082130805914079313>"
  1916. }
  1917.  
  1918. local COIN_EMOTE = "<:e:1087199766401794168>"
  1919. local PET_EMOTE = "<:e:1083222082533462098>"
  1920.  
  1921. local AUTODAYCARE_SETTINGS_FOLDER = "AutoDaycare"
  1922. local AUTODAYCARE_SETTINGS_FILE = "SaveData"
  1923.  
  1924. function SaveSettings()
  1925. pcall(function()
  1926. if not isfolder(AUTODAYCARE_SETTINGS_FOLDER) then
  1927. makefolder(AUTODAYCARE_SETTINGS_FOLDER)
  1928. end
  1929.  
  1930. local fileData = {}
  1931.  
  1932. if CurrentWorld and CurrentWorld ~= "" then
  1933. fileData.World = CurrentWorld
  1934. end
  1935.  
  1936. if CurrentPosition and CurrentPosition ~= nil then
  1937. fileData.Position = CurrentPosition
  1938. end
  1939.  
  1940. fileData.GameMode = "normal"
  1941. if Library.Shared.IsHardcore then
  1942. fileData.GameMode = "hardcore"
  1943. end
  1944.  
  1945. writefile(AUTODAYCARE_SETTINGS_FOLDER .. "/" .. AUTODAYCARE_SETTINGS_FILE .. ".json", tostring(HttpService:JSONEncode(fileData)))
  1946. end)
  1947. end
  1948.  
  1949. local IsTeleporting = false
  1950. function LoadSettings()
  1951. pcall(function()
  1952. if isfile(AUTODAYCARE_SETTINGS_FOLDER .. "/" .. AUTODAYCARE_SETTINGS_FILE .. ".json") then
  1953. local saveData = readfile(AUTODAYCARE_SETTINGS_FOLDER .. "/" .. AUTODAYCARE_SETTINGS_FILE .. ".json")
  1954. local save = HttpService:JSONDecode(saveData)
  1955.  
  1956. if not save.GameMode or save.GameMode == "" then return end
  1957.  
  1958. local shouldTeleport = false
  1959. if save.World and save.World ~= "" then
  1960. CurrentWorld = save.World
  1961. shouldTeleport = true
  1962. end
  1963.  
  1964. if save.Position and save.Position ~= nil then
  1965. CurrentPosition = save.Position
  1966. shouldTeleport = true
  1967. end
  1968.  
  1969. local gamemode = "normal"
  1970. if Library.Shared.IsHardcore then
  1971. gamemode = "hardcore"
  1972. end
  1973.  
  1974. if save.GameMode ~= gamemode then return end
  1975.  
  1976. if shouldTeleport then
  1977. IsTeleporting = true
  1978. TeleportBack()
  1979. IsTeleporting = false
  1980. end
  1981. end
  1982. end)
  1983. end
  1984.  
  1985. function SendWebhookInfo(quantity, loots)
  1986. if not Webhook_Enabled or not Webhook_Daycare or not Webhook_URL or Webhook_URL == "" then return end
  1987.  
  1988. local gamemode = "[NORMAL]"
  1989. if Library.Shared.IsHardcore then
  1990. gamemode = "[HARDCORE]"
  1991. end
  1992.  
  1993. local lootString = ""
  1994.  
  1995. local ContainsPet = false
  1996. for _, loot in pairs(loots) do
  1997. local selectedEmote = ""
  1998. if DISCORD_EMOTES[loot.Data] then
  1999. selectedEmote = DISCORD_EMOTES[loot.Data]
  2000. elseif loot.Category == "Currency" then
  2001. selectedEmote = COIN_EMOTE
  2002. elseif loot.Category == "Pet" then
  2003. ContainsPet = true
  2004. selectedEmote = PET_EMOTE
  2005. end
  2006.  
  2007. lootString = lootString .. selectedEmote .. " " .. Library.Functions.NumberShorten(loot.Min) .. " **" .. loot.Data .. "**\n"
  2008. end
  2009.  
  2010. local embed = {
  2011. ["title"] = "Daycare has been collected! " .. gamemode,
  2012. ["description"] = "Successfully collected **".. tostring(quantity) .."** pets from daycare!",
  2013. ["color"] = tonumber(0x90ff90),
  2014.  
  2015. ["fields"] = {
  2016. {
  2017. ["name"] = "Collected Loot",
  2018. ["value"] = lootString,
  2019. ["inline"] = false
  2020. }
  2021. },
  2022. ["footer"] = {
  2023. ["text"] = "Pet Simulator X",
  2024. ["icon_url"] = "https://i.imgur.com/pWIzvzD.png"
  2025. }
  2026. }
  2027.  
  2028. (syn and syn.request or http_request or http.request) {
  2029. Url = Webhook_URL;
  2030. Method = 'POST';
  2031. Headers = {
  2032. ['Content-Type'] = 'application/json';
  2033. };
  2034. Body = HttpService:JSONEncode({
  2035. username = "Daycare Update",
  2036. avatar_url = 'https://i.imgur.com/pWIzvzD.png',
  2037. embeds = {embed}
  2038. })
  2039. }
  2040. end
  2041.  
  2042.  
  2043. function TeleportToDaycare()
  2044. CurrentWorld = Library.WorldCmds.Get()
  2045.  
  2046.  
  2047. CurrentPosition = HumanoidRootPart.CFrame
  2048. task.wait()
  2049.  
  2050. -- Go to Spawn World
  2051. if CurrentWorld ~= DAYCARE_WORLD then
  2052. Library.WorldCmds.Load(DAYCARE_WORLD)
  2053. end
  2054.  
  2055. HumanoidRootPart.CFrame = CFrame.new(DAYCARE_POSITION)
  2056. end
  2057.  
  2058. function SendNotification(msg, options)
  2059. if not options then
  2060. options = {
  2061. time = 10,
  2062. color = Color3.fromRGB(160, 30, 245),
  2063. force = true
  2064. }
  2065. end
  2066.  
  2067. Library.Signal.Fire("Notification", msg, options)
  2068. end
  2069.  
  2070. function ErrorNotification(msg)
  2071. SendNotification(msg, {
  2072. time = 10, color = Color3.fromRGB(255, 60, 60), force = true
  2073. })
  2074. end
  2075.  
  2076. local BoostIcons = {
  2077. ["Triple Coins"] = "rbxassetid://7402604552",
  2078. ["Triple Damage"] = "rbxassetid://7402604431",
  2079. ["Super Lucky"] = "rbxassetid://7402604677",
  2080. ["Ultra Lucky"] = "rbxassetid://7402706511"
  2081. }
  2082.  
  2083. function CollectDaycare()
  2084. local saving = Library.Save.Get()
  2085. if not saving then
  2086. ErrorNotification("Something went wrong! Try re-logging!")
  2087. return
  2088. end
  2089.  
  2090. local success, errorMsg, pets, loots, queue = Library.Network.Invoke("Daycare: Claim", nil)
  2091. if not success then
  2092. return false, (errorMsg and "Can't claim, unknown error!")
  2093. end
  2094.  
  2095. if loots then
  2096.  
  2097. for _, loot in pairs(loots) do
  2098. -- print (tostring(loot.Category) .. ": " .. tostring(loot.Min) .. "x " .. tostring(loot.Data) )
  2099. -- Quantity: loot.Min
  2100. if loot.Category == "Currency" then
  2101. -- CurrencyIcon: Library.Directory.Currency[loot.Data].tinyImage;
  2102. elseif loot.Category == "Boost" then
  2103. -- BoostIcon = BoostIcon[loot.Data]
  2104. elseif loot.Category == "Pet" then
  2105. local petData = loot.Data;
  2106.  
  2107. -- Open Huge Egg
  2108. if petData.id ~= "1019" then
  2109. Library.Signal.Fire("Open Egg", "Huge Machine Egg 1", { petData });
  2110. end
  2111. end
  2112. end
  2113.  
  2114. end
  2115.  
  2116. if queue then
  2117. if Library.Shared.IsHardcore then
  2118. saving.DaycareHardcoreQueue = queue;
  2119. else
  2120. saving.DaycareQueue = queue;
  2121. end
  2122.  
  2123. -- Remove pets that isn't ready yet
  2124.  
  2125. for _, pet in pairs(queue) do
  2126. if pet["Pet"] and pet["Pet"].uid then
  2127. local tablePos = table.find(PetsToDaycare, pet["Pet"].uid)
  2128. if tablePos then
  2129. -- print("A pet was not ready yet!")
  2130. table.remove(PetsToDaycare, tablePos)
  2131. end
  2132. end
  2133. end
  2134.  
  2135. end
  2136.  
  2137. SendWebhookInfo(#PetsToDaycare, loots)
  2138.  
  2139. return true, nil
  2140. end
  2141.  
  2142. function PutPetsInDaycare()
  2143. local saving = Library.Save.Get()
  2144. local success, errorMsg, _ = Library.Network.Invoke("Daycare: Enroll", PetsToDaycare)
  2145. if not success then
  2146. return false, (errorMsg and "Can't enroll pets, unknown error!")
  2147. end
  2148.  
  2149. print(tostring(#PetsToDaycare) .. " pets have been put on daycare!")
  2150. task.wait(1)
  2151.  
  2152. Library.Signal.Fire("Stat Changed", "DaycareTier")
  2153. Library.Signal.Fire("Window Closed", DaycareGUI.Gui)
  2154. return true, nil
  2155. end
  2156.  
  2157. function CreateReminder()
  2158. if getgenv().AutoDaycare then
  2159. return
  2160. end
  2161.  
  2162. local saving = Library.Save.Get()
  2163.  
  2164. local queue = saving.DaycareQueue
  2165. if Library.Shared.IsHardcore then
  2166. queue = saving.DaycareHardcoreQueue
  2167. end
  2168.  
  2169. -- Check if queue isn't nil and queue lenght is more than 1 (pet)
  2170. if queue ~= nil and #queue > 0 then
  2171. getgenv().AutoDaycare = true
  2172. coroutine.wrap(function()
  2173. while true do
  2174. local allPetsAreReady = true
  2175.  
  2176. for _, pet in pairs(queue) do
  2177. local remainingTime = Library.Shared.DaycareComputeRemainingTime(saving, pet)
  2178.  
  2179. if remainingTime > 0 then
  2180. allPetsAreReady = false
  2181. break
  2182. end
  2183.  
  2184. end
  2185.  
  2186.  
  2187. if allPetsAreReady or not enableAutoDaycare then break end
  2188. task.wait(1)
  2189. end
  2190.  
  2191. getgenv().AutoDaycare = false
  2192.  
  2193. if not enableAutoDaycare then return end
  2194. if ScriptIsCurrentlyBusy then
  2195. while ScriptIsCurrentlyBusy do wait() end
  2196. ScriptIsCurrentlyBusy = true
  2197. wait(3)
  2198. end
  2199.  
  2200. ScriptIsCurrentlyBusy = true
  2201.  
  2202. --if reminder then Library.Message.New("Your pets in daycare are ready to collect!") end
  2203.  
  2204. PetsToDaycare = {}
  2205.  
  2206. for _, pet in pairs(queue) do
  2207. local remainingTime = Library.Shared.DaycareComputeRemainingTime(saving, pet)
  2208.  
  2209. if remainingTime <= 0 and pet["Pet"] and pet["Pet"].uid then
  2210. table.insert(PetsToDaycare, pet["Pet"].uid)
  2211. end
  2212. end
  2213.  
  2214. TeleportToDaycare()
  2215. task.wait(1)
  2216.  
  2217. local collected, collectError = CollectDaycare()
  2218. if not collected then
  2219. ErrorNotification(collectError)
  2220. ResetDaycare()
  2221. return
  2222. end
  2223.  
  2224. task.wait(3)
  2225.  
  2226. local enrollSuccess, enrollError = PutPetsInDaycare()
  2227. if not enrollSuccess then
  2228. ErrorNotification(enrollError)
  2229. ResetDaycare()
  2230. return
  2231. end
  2232.  
  2233. SendNotification("Successfully put pets in daycare!")
  2234. ResetDaycare()
  2235. end)()
  2236. end
  2237. end
  2238.  
  2239. function TeleportBack()
  2240. pcall(function()
  2241. -- Go to Spawn World
  2242. if CurrentWorld ~= "" and Library.WorldCmds.Get() ~= CurrentWorld then
  2243. Library.WorldCmds.Load(CurrentWorld)
  2244. end
  2245. CurrentWorld = ""
  2246.  
  2247. if CurrentPosition then
  2248. HumanoidRootPart.CFrame = CurrentPosition
  2249. end
  2250. CurrentPosition = nil
  2251. end)
  2252. end
  2253.  
  2254. function ResetDaycare()
  2255. TeleportBack()
  2256. DaycareGUI.Categories.ViewPets.Frame.PetReady.Visible = false
  2257.  
  2258. -- FIRE CLOSE CONNECTION
  2259. for _, connection in pairs(getconnections(DaycareGUI.Close.Activated)) do
  2260. connection:Fire()
  2261. end
  2262.  
  2263. wait(3)
  2264. ScriptIsCurrentlyBusy = false
  2265. end
  2266.  
  2267. Library.Signal.Fired("Stat Changed"):Connect(function(stat)
  2268. if stat == "DaycareQueue" and enableAutoDaycare then
  2269. CreateReminder()
  2270. end
  2271. end)
  2272.  
  2273. task.spawn(function()
  2274. while true do
  2275. if Automations_AutoGameComplete then
  2276. local saveData = Library.Save.Get()
  2277. local currentAreaName, nextAreaName = GetCurrentAndNextArea()
  2278. local currentArea = Library.Directory.Areas[currentAreaName]
  2279. local nextArea = Library.Directory.Areas[nextAreaName]
  2280.  
  2281. local shouldSkip = false
  2282. if currentAreaName == "Hacker Portal" then
  2283. shouldSkip = true
  2284. local ownsHackerGate = IsHardcore and saveData.Hardcore.HackerPortalUnlocked or not IsHardcore and saveData.HackerPortalUnlocked
  2285. if not ownsHackerGate then
  2286.  
  2287. local currentProgress, currentMission = unpack(IsHardcore and saveData.Hardcore.HackerPortalProgress or saveData.HackerPortalProgress)
  2288. if currentMission < 0 then
  2289. -- Start quest
  2290. local map = Library.WorldCmds.GetMap()
  2291. local interactive = nil
  2292. if map then interactive = map:FindFirstChild("Interactive") end
  2293.  
  2294. local hackerPortal = nil
  2295. if interactive then hackerPortal = interactive:FindFirstChild("Hacker Portal") end
  2296.  
  2297. local interactLocation = nil
  2298. if hackerPortal then interactLocation = hackerPortal:FindFirstChild("_INTERACT") end
  2299.  
  2300. if interactLocation then
  2301. HumanoidRootPart.CFrame = CFrame.new(interactLocation.CFrame.p) + (interactLocation.CFrame.RightVector * 10)
  2302. SendNotification("Starting hacker portal mission...")
  2303. Library.Network.Fire("Start Hacker Portal Quests")
  2304. currentMission = 1
  2305. end
  2306. end
  2307.  
  2308. if currentMission > 1 then
  2309. currentMission = 1
  2310. currentProgress = Library.Shared.HackerPortalQuests[1]
  2311.  
  2312. end
  2313.  
  2314. if currentMission > -1 then
  2315. local totalToComplete = Library.Shared.HackerPortalQuests[currentMission]
  2316. if totalToComplete and tonumber(totalToComplete) and currentProgress >= totalToComplete then
  2317. local map = Library.WorldCmds.GetMap()
  2318. local interactive = nil
  2319. if map then interactive = map:FindFirstChild("Interactive") end
  2320.  
  2321. local hackerPortal = nil
  2322. if interactive then hackerPortal = interactive:FindFirstChild("Hacker Portal") end
  2323.  
  2324. local interactLocation = nil
  2325. if hackerPortal then interactLocation = hackerPortal:FindFirstChild("_INTERACT") end
  2326.  
  2327. if interactLocation then
  2328. HumanoidRootPart.CFrame = CFrame.new(interactLocation.CFrame.p) + (interactLocation.CFrame.RightVector * 10)
  2329. wait(0.3)
  2330. end
  2331.  
  2332. if Library.Network.Invoke("Finish Hacker Portal Quest") then
  2333. SendNotification("Unlocking Void...")
  2334. Library.WorldCmds.Load("Void")
  2335. wait(2)
  2336. SendNotification("Unlocking ".. nextAreaName .. "...")
  2337. Library.WorldCmds.Load(nextArea.world)
  2338. wait(1)
  2339. end
  2340. end
  2341. end
  2342. else
  2343. SendNotification("Unlocking Void...")
  2344. Library.WorldCmds.Load("Void")
  2345. wait(2)
  2346. SendNotification("Unlocking ".. nextAreaName .. "...")
  2347. Library.WorldCmds.Load(nextArea.world)
  2348. wait(1)
  2349. end
  2350. end
  2351.  
  2352. if nextAreaName ~= "COMPLETED" and not shouldSkip and CheckIfCanAffordArea(nextAreaName) then
  2353. -- Buy area
  2354. local currentWorld = Library.WorldCmds.Get()
  2355. if currentWorld ~= nextArea.world then
  2356. Library.WorldCmds.Load(nextArea.world)
  2357. wait(1)
  2358. end
  2359.  
  2360. local map = Library.WorldCmds.GetMap()
  2361. local allGates = nil
  2362. if map then allGates = map:FindFirstChild("Gates") end
  2363.  
  2364. local successfullyTeleported = false
  2365. if allGates and allGates:FindFirstChild(nextAreaName) then
  2366. local gate = allGates:FindFirstChild(nextAreaName):FindFirstChild("Gate")
  2367. if gate and gate:FindFirstChild("GateHUD") then
  2368. local gateTP = gate:FindFirstChild("GateHUD").Parent
  2369. if gateTP then
  2370. HumanoidRootPart.CFrame = CFrame.new(gateTP.CFrame.p) * CFrame.new(1,0,0)
  2371. successfullyTeleported = true
  2372. end
  2373. end
  2374. elseif currentArea.world == "Fantasy" then
  2375. local interactive = map:FindFirstChild("Interactive")
  2376. local portals = nil
  2377. if interactive then portals = interactive:FindFirstChild("Portals") end
  2378. if portals and portals:FindFirstChild(nextAreaName) then
  2379. local portal = portals:FindFirstChild(nextAreaName)
  2380. HumanoidRootPart.CFrame = CFrame.new(portal.PrimaryPart.CFrame.p) + (portal.PrimaryPart.CFrame.RightVector * 5)
  2381. successfullyTeleported = true
  2382. end
  2383.  
  2384. end
  2385.  
  2386. if successfullyTeleported then
  2387. wait(0.1)
  2388. SendNotification("Unlocking ".. nextAreaName .. "...")
  2389. local success, errorMsg = Library.Network.Invoke("Buy Area", nextAreaName)
  2390. if success then
  2391. if currentAreaName == "Cat Kingdom" then
  2392. SendNotification("Unlocking Limbo...")
  2393. Library.WorldCmds.Load("Limbo")
  2394. wait(1)
  2395. end
  2396. -- TELEPORT TO THE NEW AREA
  2397. local areaTeleport = Library.WorldCmds.GetMap().Teleports:FindFirstChild(nextAreaName);
  2398. if areaTeleport then
  2399. Library.Signal.Fire("Teleporting")
  2400. task.wait(0.25)
  2401. Character:PivotTo(areaTeleport.CFrame + areaTeleport.CFrame.UpVector * (Humanoid.HipHeight + HumanoidRootPart.Size.Y / 2))
  2402. Library.Network.Fire("Performed Teleport", nextAreaName)
  2403. task.wait(0.25)
  2404. end
  2405. end
  2406. end
  2407.  
  2408. wait(1)
  2409. else
  2410. -- NOT AVAILABLE YET
  2411. -- Start farming? Teleport to area? Idk yet
  2412. end
  2413. end
  2414.  
  2415. task.wait(0.5)
  2416. end
  2417. end)
  2418.  
  2419.  
  2420. local settingsTab = Window:CreateTab("Settings", "13075268290", true)
  2421. local windowSettings = settingsTab:CreateSection("General Options", false, false, "13080063021")
  2422.  
  2423. settingsTab:CreateToggle({
  2424. Name = "Compact Mode",
  2425. CurrentValue = false,
  2426. Flag = "Settings_CompactMode",
  2427. SectionParent = windowSettings,
  2428. Callback = function(value)
  2429. Rayfield:ToggleOldTabStyle(not value)
  2430. end
  2431. })
  2432.  
  2433. settingsTab:CreateToggle({
  2434. Name = "Disable Rendering when Alt-Tab",
  2435. CurrentValue = true,
  2436. Flag = "Settings_DisableRendering",
  2437. SectionParent = windowSettings,
  2438. Callback = function(value)
  2439. Settings_DisableRendering = value
  2440. end
  2441. })
  2442.  
  2443. local discordSettings = settingsTab:CreateSection("Webhook Options", false, true, "13085068876")
  2444. settingsTab:CreateToggle({
  2445. Name = "Enable Webhook",
  2446. CurrentValue = false,
  2447. Flag = "Webhook_Enabled",
  2448. SectionParent = discordSettings,
  2449. Callback = function(value)
  2450. Webhook_Enabled = value
  2451. end
  2452. })
  2453.  
  2454. local WebhookURLInput = settingsTab:CreateInput({
  2455. Name = "Webhook URL",
  2456. PlaceholderText = "Paste your Discord Webhook here",
  2457. SectionParent = discordSettings,
  2458. NumbersOnly = false,
  2459. OnEnter = false,
  2460. RemoveTextAfterFocusLost = false,
  2461. Callback = function(Text)
  2462. SaveCustomFlag("Webhook_URL", Text)
  2463. end,
  2464.  
  2465. })
  2466.  
  2467. AddCustomFlag("Webhook_URL", "", function(newValue)
  2468. Webhook_URL = newValue
  2469. if WebhookURLInput and newValue and newValue ~= "" then
  2470. WebhookURLInput:Set(newValue)
  2471. end
  2472. end)
  2473.  
  2474. settingsTab:CreateToggle({
  2475. Name = "Daycare Updates",
  2476. CurrentValue = false,
  2477. Flag = "Webhook_Daycare",
  2478. SectionParent = discordSettings,
  2479. Callback = function(value)
  2480. Webhook_Daycare = value
  2481. end
  2482. })
  2483.  
  2484. -- TODO: Change this to a Dropdown with rarities to notify
  2485. settingsTab:CreateToggle({
  2486. Name = "Notify Huge Hatches",
  2487. CurrentValue = false,
  2488. Flag = "Webhook_Huge",
  2489. SectionParent = discordSettings,
  2490. Callback = function(value)
  2491. Webhook_Huge = value
  2492. end
  2493. })
  2494.  
  2495. Rayfield.LoadConfiguration()
  2496.  
  2497. for i,v in pairs(getconnections(game.Players.LocalPlayer.Idled)) do
  2498. v:Disable()
  2499. end
  2500.  
  2501. InputService.WindowFocused:Connect(function()
  2502. RunService:Set3dRenderingEnabled(true)
  2503. end)
  2504.  
  2505. InputService.WindowFocusReleased:Connect(function()
  2506. if Settings_DisableRendering then
  2507. RunService:Set3dRenderingEnabled(false)
  2508. end
  2509. end)
  2510. end
  2511.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement