Advertisement
KrystekYY

Untitled

Jul 31st, 2022 (edited)
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1.  
  2. if not workspace.__THINGS.__REMOTES:FindFirstChild("fuse pets") then
  3. workspace.__THINGS.__REMOTES.MAIN:FireServer("b", "fuse pets")
  4. repeat wait() until workspace.__THINGS.__REMOTES:FindFirstChild("fuse pets")
  5. end
  6.  
  7. local Library = require(game:GetService("ReplicatedStorage").Framework.Library)
  8. local IDToName = {}
  9. local NameToID = {}
  10. for i,v in pairs(Library.Directory.Pets ) do
  11. IDToName[i] = v.name
  12. NameToID[v.name] = i
  13. end
  14.  
  15. function GetPets()
  16. local MyPets = {}
  17. for i,v in pairs(Library.Save.Get().Pets) do
  18. local ThingyThingyTempTypeThing = (v.g and 'Gold') or (v.r and 'Rainbow') or (v.dm and 'Dark Matter') or 'Normal'
  19. local TempString = ThingyThingyTempTypeThing .. IDToName[v.id]
  20. if MyPets[TempString] then
  21. table.insert(MyPets[TempString], v.uid)
  22. else
  23. MyPets[TempString] = {}
  24. table.insert(MyPets[TempString], v.uid)
  25. end
  26. end
  27. return MyPets
  28. end
  29.  
  30. function IsPossibleFuse(DirectoryOfPets, tier)
  31. local ispossible = true
  32. local Pets = GetPets()
  33. local totalfusenum = 0
  34. for i,v in pairs(DirectoryOfPets) do
  35. local TempString = tier .. i
  36. if not Pets[TempString] or #Pets[TempString] < v then
  37. ispossible = false
  38. end
  39. totalfusenum = totalfusenum + v
  40. end
  41. if totalfusenum > 12 then
  42. ispossible = false
  43. end
  44. return ispossible
  45. end
  46.  
  47. local otherfuselist = {}
  48. function getapet(petname, tier)
  49. local LookingFor = (tier == "Gold" and 'g') or (tier == "Rainbow" and 'r') or (tier == "Dark Matter" and 'dm') or tier == "Normal" and 'eeeeee'
  50. local WantedPetID = NameToID[petname]
  51. for i,v in pairs(Library.Save.Get().Pets) do
  52. if v.id == WantedPetID and (tier == 'Normal' or v[LookingFor]) and not table.find(otherfuselist, v.uid) then
  53. return v.uid
  54. end
  55. end
  56. end
  57.  
  58. while wait() and getgenv().EnabledCustomFuse do
  59. for ee, eeee in pairs(getgenv().CustomFuseTiers) do
  60. if eeee then
  61. for i,v in pairs(getgenv().CustomFuseList[ee]) do
  62. if IsPossibleFuse(v, ee) then
  63. local EekFuselist = {}
  64. otherfuselist = {}
  65. for a,b in pairs(v) do
  66. for eeeek = 1, b do
  67. local PetUID = getapet(a, ee)
  68. EekFuselist[#EekFuselist + 1] = PetUID
  69. table.insert(otherfuselist, PetUID)
  70. print(PetUID)
  71. end
  72. end
  73. print(unpack(workspace.__THINGS.__REMOTES["fuse pets"]:InvokeServer({[1] = EekFuselist})))
  74. wait(0.1)
  75. end
  76. end
  77. end
  78. end
  79. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement