Daniel8cz

Pet sim x Script

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