Advertisement
pastebinxx

Untitled

Mar 27th, 2025
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.53 KB | None | 0 0
  1. getgenv().Settings = {
  2.  
  3. ["Raid Settings"] = {
  4. Enabled = true, --// false --> Will Farm Main Area (if FarmArea = true)
  5.  
  6. JoinRaid = "Username", --// Join an alts raid (or just delete this).
  7. Difficulty = "Max", --// "Max", 1-...
  8. Type = "Solo", --// "Solo", "Friends", "Friends & Clan", "Open"
  9.  
  10. LeaveRaid = {}, --// Rejoin raid if any of these are found.
  11. --// Chest, Big Chest, Massive Chest, Pot Of Gold Chest
  12.  
  13. OpenBosses = {},
  14. UpgradeBossChests = true,
  15. OpenLeprechaunChest = false,
  16.  
  17. ["Egg Settings"] = {
  18. Enabled = true, --// false --> Will leave and keep farming Raids.
  19. MinimumEggMulti = 700, --// 20 --> 20x
  20. MinimumLuckyCoins = "1m",
  21. MaxOpenTime = 50000, --// 60 --> 60 minutes.
  22. },
  23. },
  24.  
  25. ["Main Area Settings"] = {
  26. FarmArea = false,
  27. PurchaseUpgrades = false,
  28. },
  29.  
  30. [[ Created by System Exodus // Jxnt ]]
  31. }
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. local Players = game:GetService("Players")
  46. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  47. local HttpService = game:GetService("HttpService")
  48. local VirtualUser = game:GetService("VirtualUser")
  49.  
  50. local LocalPlayer = Players.LocalPlayer
  51. repeat task.wait()
  52. LocalPlayer = Players.LocalPlayer
  53. until LocalPlayer and LocalPlayer.GetAttribute and LocalPlayer:GetAttribute("__LOADED")
  54. if not LocalPlayer.Character then
  55. LocalPlayer.CharacterAdded:Wait()
  56. end
  57. local HumanoidRootPart = LocalPlayer.Character.HumanoidRootPart
  58.  
  59.  
  60. local NLibrary = game.ReplicatedStorage.Library
  61. local Network = require(NLibrary.Client.Network)
  62. local PlayerSave = require(NLibrary.Client.Save)
  63.  
  64. local RaidCmds = require(NLibrary.Client.RaidCmds)
  65. local RaidInstance = require(NLibrary.Client.RaidCmds.RaidInstance)
  66. local CurrentRaid = RaidInstance.GetByOwner(game.Players.LocalPlayer)
  67. local EventUpgradeCmds = require(NLibrary.Client.EventUpgradeCmds)
  68. local EventUpgrades = require(NLibrary.Directory.EventUpgrades)
  69. local Functions = require(NLibrary.Functions)
  70. local Items = require(NLibrary.Items)
  71. local PetNetworking = require(NLibrary.Client.PetNetworking)
  72. local InstancingCmds = require(NLibrary.Client.InstancingCmds)
  73. local EggCmds = require(NLibrary.Client.EggCmds)
  74. local MapCmds = require(NLibrary.Client.MapCmds)
  75. local CurrencyCmds = require(NLibrary.Client.CurrencyCmds)
  76. local CustomEggsCmds = require(NLibrary.Client.CustomEggsCmds)
  77. local CalcEggPrice = require(NLibrary.Balancing.CalcEggPrice)
  78. local MasteryCmds = require(NLibrary.Client.MasteryCmds)
  79. local Functions = require(NLibrary.Functions)
  80. local EggFrontend = getsenv(LocalPlayer.PlayerScripts.Scripts.Game:WaitForChild("Egg Opening Frontend"))
  81. local Raids = require(NLibrary.Types.Raids)
  82.  
  83. local function EnterInstance(Name)
  84. if InstancingCmds.GetInstanceID() == Name then return end
  85. setthreadidentity(2)
  86. InstancingCmds.Enter(Name)
  87. setthreadidentity(8)
  88. task.wait(0.25)
  89. if InstancingCmds.GetInstanceID() ~= Name then
  90. EnterInstance(Name)
  91. end
  92. end
  93.  
  94. local SuffixesLower = {"k", "m", "b", "t"}
  95. local SuffixesUpper = {"K", "M", "B", "T"}
  96. local function RemoveSuffix(Amount)
  97. local a, Suffix = Amount:gsub("%a", ""), Amount:match("%a")
  98. local b = table.find(SuffixesUpper, Suffix) or table.find(SuffixesLower, Suffix) or 0
  99. return tonumber(a) * math.pow(10, b * 3)
  100. end
  101.  
  102. local ActiveInstances = workspace.__THINGS.__INSTANCE_CONTAINER.Active
  103. local Raid = Settings["Raid Settings"]
  104. local Main = Settings["Main Area Settings"]
  105. if type(Raid["Egg Settings"].MinimumLuckyCoins) ~= "numer" then
  106. Raid["Egg Settings"].MinimumLuckyCoins = RemoveSuffix(Raid["Egg Settings"].MinimumLuckyCoins)
  107. end
  108.  
  109. --// Breakable & Pet Equip Gathering \\--
  110. local BreakablesFolder = workspace.__THINGS.Breakables
  111. local BreakablesList = {}
  112. for _,v in pairs(BreakablesFolder:GetChildren()) do
  113. if v:IsA("Model") then
  114. local UID, Zone = v:GetAttribute("BreakableUID"), v:GetAttribute("ParentID")
  115. if (Raid.Enabled and Zone == "LuckyRaid") or (not Raid.Enabled and Zone == "LuckyEventWorld") then
  116. BreakablesList[UID] = v
  117. end
  118. end
  119. end
  120. BreakablesFolder.ChildAdded:Connect(function(Breakable)
  121. task.wait()
  122. if Breakable:IsA("Model") then
  123. local UID, Zone, Name = Breakable:GetAttribute("BreakableUID"), Breakable:GetAttribute("ParentID"), Breakable:GetAttribute("BreakableID")
  124. if (Raid.Enabled and Zone == "LuckyRaid") or (not Raid.Enabled and Zone == "LuckyEventWorld") then
  125. BreakablesList[UID] = Breakable
  126. end
  127. end
  128. end)
  129. BreakablesFolder.ChildRemoved:Connect(function(Breakable)
  130. task.wait()
  131. local UID = Breakable:GetAttribute("BreakableUID")
  132. if BreakablesList[UID] then
  133. BreakablesList[UID] = nil
  134. end
  135. end)
  136.  
  137. local EquippedPets = {}
  138. for _,v in pairs(PetNetworking.EquippedPets()) do
  139. if not EquippedPets[v.euid] then
  140. table.insert(EquippedPets, v.euid)
  141. end
  142. end
  143. Network.Fired("Pets_LocalPetsUpdated"):Connect(function(Pet)
  144. for _,v in pairs(Pet) do
  145. if not EquippedPets[v.ePet.euid] then
  146. table.insert(EquippedPets, v.ePet.euid)
  147. end
  148. end
  149. end)
  150. Network.Fired("Pets_LocalPetsUnequipped"):Connect(function(Pet)
  151. for _,v in pairs(Pet) do
  152. if EquippedPets[v] then
  153. EquippedPets[v] = nil
  154. end
  155. end
  156. end)
  157. Network.Fired("Orbs: Create"):Connect(function(Orbs)
  158. local Collect = {}
  159. for _, v in ipairs(Orbs) do
  160. local ID = tonumber(v.id)
  161. if ID then
  162. table.insert(Collect, ID)
  163. end
  164. end
  165. if #Collect > 0 then
  166. Network.Fire("Orbs: Collect", Collect)
  167. for _, ID in ipairs(Collect) do
  168. local Orb = workspace.__THINGS.Orbs:FindFirstChild(tostring(ID))
  169. if Orb then
  170. Orb:Destroy()
  171. end
  172. end
  173. end
  174. end)
  175.  
  176. local function GetUpgradeTypes(ID)
  177. if ID:find("XP") then return "XP" end
  178. if ID:find("Damage") then return "Damage" end
  179. if ID:find("AttackSpeed") then return "AttackSpeed" end
  180. if ID:find("Pets") then return "Pets" end
  181. return "Other"
  182. end
  183. local RequiredUpgrades = {XP = false, Damage = false, AttackSpeed = false, Pets = false}
  184.  
  185. --// Gather & Purchase LuckyRaid Upgrades \\--
  186. local LuckyUpgrades = {}
  187. for ID, Data in next, EventUpgrades do
  188. if ID:find("LuckyRaid") then
  189. LuckyUpgrades[ID] = Data
  190. end
  191. end
  192. local Orb = Items.Misc("Lucky Raid Orb")
  193. local function PurchaseUpgrades()
  194. local Upgrade, LowestCost = nil, math.huge
  195. for ID, Data in next, LuckyUpgrades do
  196. local UpgradeType = GetUpgradeTypes(ID)
  197. local Tier = EventUpgradeCmds.GetTier(ID)
  198. if not Data.TierCosts[Tier + 1] or not Data.TierCosts[Tier + 1]._data then
  199. if table.find(RequiredUpgrades, UpgradeType) then
  200. RequiredUpgrades[UpgradeType] = true
  201. end
  202. continue
  203. end
  204. if UpgradeType ~= "Other" or (UpgradeType == "Other" and RequiredUpgrades["XP"] and RequiredUpgrades["Damage"] and RequiredUpgrades["AttackSpeed"] and RequiredUpgrades["Pets"]) then
  205. local Cost = Data.TierCosts[Tier + 1]._data._am or 1
  206. if Cost and Cost < LowestCost and Orb:CountExact() >= Cost then
  207. LowestCost = Cost
  208. Upgrade = ID
  209. end
  210. end
  211. end
  212. if Upgrade then
  213. EventUpgradeCmds.Purchase(Upgrade)
  214. end
  215. return Upgrade
  216. end
  217.  
  218. local function FarmBreakables()
  219. local RemoteList = {}
  220.  
  221. local PetArray = {}
  222. for _,ID in pairs(EquippedPets) do
  223. table.insert(PetArray, ID)
  224. end
  225.  
  226. local BreakableArray = {}
  227. for UID, Breakable in pairs(BreakablesList) do
  228. Name = Breakable:GetAttribute("BreakableID")
  229. Name = (Name:gsub("LuckyRaid", ""):gsub("(%l)(%u)", "%1 %2"))
  230. if Raid.LeaveRaid and table.find(Raid.LeaveRaid, Name) then
  231. continue
  232. end
  233. table.insert(BreakableArray, UID)
  234. end
  235.  
  236. local PetIndex = 1
  237. local BreakableIndex = 1
  238. local BreakableCount = #BreakableArray
  239. local PetCount = #PetArray
  240.  
  241. if PetCount == 0 or BreakableCount == 0 then
  242. return
  243. end
  244. while PetIndex <= PetCount do
  245. local PetID = PetArray[PetIndex]
  246. local BreakableUID = BreakableArray[BreakableIndex]
  247. RemoteList[PetID] = BreakableUID
  248.  
  249. PetIndex = PetIndex + 1
  250. BreakableIndex = BreakableIndex + 1
  251. if BreakableIndex > BreakableCount then
  252. BreakableIndex = 1
  253. end
  254. end
  255. if next(RemoteList) then
  256. Network.UnreliableFire("Breakables_PlayerDealDamage", BreakableArray[1])
  257. Network.Fire("Breakables_JoinPetBulk", RemoteList)
  258. end
  259. end
  260.  
  261. --// Translate "Solo" into respected ID for remote
  262. local PortalIDs = {
  263. ["Solo"] = 1,
  264. ["Friends"] = 2,
  265. ["Friends & Clan"] = 3,
  266. ["Open"] = 4,
  267. }
  268.  
  269. --// Anti AFK
  270. LocalPlayer.PlayerScripts.Scripts.Core["Server Closing"].Enabled = false
  271. LocalPlayer.PlayerScripts.Scripts.Core["Idle Tracking"].Enabled = false
  272. Network.Fire("Idle Tracking: Stop Timer")
  273. LocalPlayer.Idled:Connect(function()
  274. VirtualUser:CaptureController()
  275. VirtualUser:ClickButton2(Vector2.new())
  276. end)
  277.  
  278. --// Remove Egg Animation
  279. EggFrontend.PlayEggAnimation = function(...)
  280. return
  281. end
  282.  
  283. local function OpenBossRooms(CurrentRaid)
  284. if not CurrentRaid then return end
  285. for i,v in pairs(Raids.BossDirectory) do
  286. if CurrentRaid._roomNumber >= v.RequiredRoom and table.find(Raid.OpenBosses, "Boss "..v.BossNumber) then
  287. if Raid.UpgradeBossChests then
  288. Network.Invoke("LuckyRaid_PullLever", v.BossNumber)
  289. task.wait(0.25)
  290. end
  291. if v.BossNumber ~= 3 or (v.BossNumber == 3 and Items.Misc("Lucky Raid Boss Key"):CountExact() >= 1) then
  292. local timer = os.time()
  293. repeat task.wait()
  294. Success, Error = Network.Invoke("Raids_StartBoss", v.BossNumber)
  295. until Success or Error or os.time()-timer >= 5
  296. if Success then
  297. task.wait(v.BossNumber == 3 and 1 or 0.25)
  298. end
  299. end
  300. end
  301. end
  302. end
  303.  
  304.  
  305. EnterInstance("LuckyEventWorld")
  306. if Raid.Enabled then
  307. while task.wait() and Raid.Enabled do
  308.  
  309. --// Purchase Upgrades
  310. if Main and Main.PurchaseUpgrades then
  311. PurchaseUpgrades()
  312. end
  313.  
  314. --// Find open raid (if any)
  315. local CurrentRaid = RaidInstance.GetByOwner(LocalPlayer)
  316. local JoinRaid = Raid.JoinRaid and Raid.JoinRaid ~= "Username" and Raid.JoinRaid ~= "" and Raid.JoinRaid
  317. if not JoinRaid and (not CurrentRaid or (CurrentRaid and (CurrentRaid._completed or LeftOnPurpose))) then
  318. LeftOnPurpose = false
  319.  
  320. --// Grab Current Raid Level
  321. local Level = RaidCmds.GetLevel()
  322. local OpenPortal;
  323. --// Loop through every portal to find an open slot or users own portal (dont judge.)
  324. for i = 1,10 do
  325. local Portal = RaidInstance.GetByPortal(i)
  326. if not Portal or (Portal and Portal._owner == game.Players.LocalPlayer) then
  327. OpenPortal = i
  328. break
  329. end
  330. end
  331. Network.Fire("Instancing_PlayerLeaveInstance", "LuckyRaid")
  332. --// Create portal using user params.
  333. Network.Invoke("Raids_RequestCreate", {
  334. ["Difficulty"] = (type(Raid.Difficulty) == "number" and Level >= Raid.Difficulty and Raid.Difficulty) or Level,
  335. ["Portal"] = OpenPortal,
  336. ["PartyMode"] = PortalIDs[Raid.Type]
  337. })
  338. end
  339. --// Wait until game registers a portal.
  340. repeat task.wait(0.25)
  341. CurrentRaid = RaidInstance.GetByOwner(JoinRaid or LocalPlayer)
  342. until CurrentRaid
  343. if CurrentRaid then
  344. --// Farming Raids \\--
  345. local RaidID = CurrentRaid._id
  346. Network.Invoke("Raids_Join", RaidID)
  347. repeat task.wait() until ActiveInstances:FindFirstChild("LuckyRaid")
  348. local StartingTime = os.time()
  349. local LastBreakable;
  350. local Name;
  351. local Breakable, Data;
  352. repeat task.wait(0.1)
  353. OpenBossRooms(CurrentRaid)
  354. Breakable, Data = next(BreakablesList)
  355. if not Data and (os.time()-StartingTime) >= 10 then
  356. --// Breakables most likely didn't spawn, restarting raid
  357. LeftOnPurpose = true;
  358. break
  359. end
  360. if (LastBreakable ~= Breakable or not MapCmds.IsInDottedBox()) and Data and Data:FindFirstChildOfClass("MeshPart") then
  361. Name = Data:GetAttribute("BreakableID")
  362. Name = (Name:gsub("LuckyRaid", ""):gsub("(%l)(%u)", "%1 %2"))
  363. if Raid.LeaveRaid and table.find(Raid.LeaveRaid, Name) then
  364. --// Breakable is part of banned breakable list, leave/restart
  365. LeftOnPurpose = true
  366. break
  367. end
  368. LastBreakable = Breakable
  369. HumanoidRootPart.CFrame = Data:FindFirstChildOfClass("MeshPart").CFrame * CFrame.new(0,2,0)
  370. end
  371. FarmBreakables()
  372. until ActiveInstances.LuckyRaid.INTERACT:FindFirstChild("LootChest") and not Breakable
  373.  
  374. --// Loop through every chest the player can open, really stupid but not terrible lmao
  375. for _, Chest in pairs(ActiveInstances.LuckyRaid.INTERACT:GetChildren()) do
  376. if Chest.Name:find("Sign") or (Chest.Name:find("Leprechaun") and (not Raid.OpenLeprechaunChest or Library.Items.Misc("Lucky Key"):CountExact() < 1)) then
  377. continue
  378. end
  379. local Success;
  380. HumanoidRootPart.CFrame = Chest:FindFirstChildOfClass("MeshPart").CFrame
  381. repeat task.wait()
  382. Success = Network.Invoke("Raids_OpenChest", Chest.Name)
  383. until Success
  384. end
  385.  
  386. --// Opening Raid Egg \\--
  387. if Raid["Egg Settings"].Enabled and PlayerSave.Get().RaidEggMultiplier and PlayerSave.Get().RaidEggMultiplier >= Raid["Egg Settings"].MinimumEggMulti and CurrencyCmds.CanAfford("LuckyCoins", Raid["Egg Settings"].MinimumLuckyCoins) then
  388. EnterInstance("LuckyEgg")
  389.  
  390. local LuckyEgg;
  391. local EggPrice;
  392. --// Find and Calculate the Custom Egg Price w/ Upgrades
  393. repeat task.wait()
  394. for UID, Info in next, CustomEggsCmds.All() do
  395. if workspace.__THINGS.CustomEggs:FindFirstChild(UID) then
  396. local Power = EventUpgradeCmds.GetPower("LuckyRaidEggCost")
  397. local CheaperEggs = MasteryCmds.HasPerk("Eggs", "CheaperEggs") and MasteryCmds.GetPerkPower("Eggs", "CheaperEggs") or 0
  398. EggPrice = CalcEggPrice(Info._dir) * (1 - Power / 100) * (1 - CheaperEggs / 100)
  399. LuckyEgg = UID
  400. break
  401. end
  402. end
  403. until LuckyEgg and EggPrice
  404. local StartingTime = os.time()
  405. local MaxEggHatch = EggCmds.GetMaxHatch()
  406. local NeedsPrice = EggPrice * MaxEggHatch
  407. repeat task.wait(0.1)
  408. Network.Invoke("CustomEggs_Hatch", LuckyEgg, MaxEggHatch)
  409. until not CurrencyCmds.CanAfford("LuckyCoins", NeedsPrice) or (os.time() - StartingTime) >= (Raid["Egg Settings"].MaxOpenTime * 60)
  410. end
  411. end
  412. end
  413. else
  414. while task.wait() and Main.FarmArea do
  415. FarmBreakables()
  416. if not MapCmds.IsInDottedBox() then
  417. local _, v = next(BreakablesList)
  418. if v and v:FindFirstChildOfClass("MeshPart") then
  419. HumanoidRootPart.CFrame = v:FindFirstChildOfClass("MeshPart").CFrame * CFrame.new(0,2,0)
  420. end
  421. end
  422. end
  423. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement