Advertisement
IHATEMICROWAVEOVEN

unadded moves detector

Sep 4th, 2023
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. local movesAndMons = {}
  2. local movesToIndex = {}
  3. local movesPathway = game.StarterGui.SkillsGui.WeaponsController
  4.  
  5. local function registerWeapons(monName, weaponsFolder)
  6. for i, Weapon in ipairs(weaponsFolder:GetChildren()) do
  7. local name = Weapon.Value
  8. if not movesPathway.ClientModules:FindFirstChild(name) or not movesPathway.ServerModules:FindFirstChild(name) then
  9. if movesToIndex[name]==nil then table.insert(movesAndMons, {name}) movesToIndex[name]=#movesAndMons end
  10. table.insert(movesAndMons[movesToIndex[name]], monName)
  11. end
  12. end
  13. end
  14.  
  15. local function iterateThroughMons(target)
  16. for i, Child in ipairs(target:GetChildren()) do
  17. if Child.Name == "Weapons" then
  18. registerWeapons(target.Name, Child)
  19. elseif Child:IsA("Folder") and Child.Name~="SetStatsOnSpawn" then
  20. iterateThroughMons(Child)
  21. end
  22. end
  23. end
  24.  
  25. for i, Region in ipairs(game.StarterGui.GameGui.LocalScript.Pokemon:GetChildren()) do
  26. for j, EvoLine in ipairs(Region:GetChildren()) do
  27. iterateThroughMons(EvoLine)
  28. end
  29. end
  30.  
  31. table.sort(movesAndMons, function(a,b) if #a==#b then return a[1]<b[1] else return #a>#b end end)
  32.  
  33. local bigStringToPrint = ""
  34. for i, Table in ipairs(movesAndMons) do
  35. local listString = Table[1].." ("
  36. table.remove(Table, 1)
  37. for i, Mon in ipairs(Table) do listString = listString..Mon..", " end
  38. bigStringToPrint = bigStringToPrint..string.sub(listString, 1, string.len(listString)-2)..")\n"
  39. end
  40. print(bigStringToPrint)
  41. print("All done!!!")
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement