Advertisement
IHATEMICROWAVEOVEN

PA Easy Mon Creator

Jun 4th, 2024 (edited)
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.40 KB | None | 0 0
  1. local function doThat()
  2.  
  3. local putDirectoryIn = game.StarterGui.GameGui.LocalScript.Pokemon
  4.  
  5. --[==[
  6. local newMons = {
  7. {
  8. ["Name"] = Name,
  9. --[[ setstatsonspawn ]]--
  10. ["Type"] = {Type1, Type2},
  11. ["Immunity"] = {immunity1, immunity2, etc (e.g. Fire)},
  12. --[[ ["CPKMN"] = current_pokemon, (only include this if you need a custom value) ]]--
  13. --[[ weapons ]]--
  14. ["Weapons"] = {Move1, Move2, Move3, Move4},
  15. --[[ other ]]--
  16. ["Stats"] = {Health, Speed, Jump},
  17. ["FirstStageStats"] = {Stat, ImageId},
  18. ["EvoStageStats"] = {Need, Mega},
  19. ["Evos"] = {
  20. blah
  21. }
  22. },
  23.  
  24. blah
  25. }
  26. ]==]--
  27.  
  28.  
  29.  
  30. local newMons = {
  31.  
  32. }
  33.  
  34.  
  35.  
  36.  
  37.  
  38. local types = {None = 0, Normal = 1, Fire = 2, Water = 3, Electric = 4, Grass = 5, Ice = 6, Fighting = 7, Poison = 8, Ground = 9, Flying = 10, Psychic = 11, Bug = 12, Rock = 13, Ghost = 14, Dragon = 15, Dark = 16, Steel = 17, Fairy = 18}
  39.  
  40. local hierarchy = "Success! Created the following lines:\n"
  41. local fullNormalMessage = "Probably normal:\n"
  42. local fullErrorMessage = "Possible errors:\n"
  43. local statsToPaste = "To paste in StarterData:\n"
  44.  
  45.  
  46. local function appendNorm(message)
  47. fullNormalMessage = fullNormalMessage..message.."\n"
  48. end
  49.  
  50. local function appendErr(message)
  51. fullErrorMessage = fullErrorMessage..message.."\n"
  52. end
  53.  
  54. local function appendStat(stat)
  55. statsToPaste = statsToPaste..",\n\t\t[\""..stat.."\"] = {\n\t\t\t[\"Permament\"] = true;\n\t\t\t[\"DefaultValue\"] = 0;\n\t\t\t[\"Special\"] = nil\n\t\t}"
  56. end
  57.  
  58.  
  59.  
  60.  
  61.  
  62. local function constructMon(monData, isEvolution)
  63. local name = monData["Name"]
  64. local monFolder = Instance.new("Folder")
  65. monFolder.Name = name
  66.  
  67.  
  68.  
  69. --[[ SETSTATSONSPAWN ]]--
  70. local ssos = Instance.new("Folder")
  71. ssos.Name = "SetStatsOnSpawn"
  72.  
  73. --[[ Current_Pokemon ]]--
  74. local cpkmn = Instance.new("StringValue")
  75. cpkmn.Name = "Current_Pokemon"
  76. if monData["CPKMN"] then
  77. cpkmn.Value = monData["CPKMN"]
  78. appendNorm(name.." Current_Pokemon value set to "..monData["CPKMN"])
  79. else
  80. cpkmn.Value = name
  81. end
  82. cpkmn.Parent = ssos
  83.  
  84. --[[ IncreaseHealth ]]--
  85. local incHealth = Instance.new("NumberValue")
  86. incHealth.Name = "IncreaseHealth"
  87. incHealth.Value = 1
  88. incHealth.Parent = ssos
  89.  
  90. --[[ Type1 ]]--
  91. local type1 = Instance.new("NumberValue")
  92. type1.Name = "Type"
  93. if monData["Type"] then
  94. if monData["Type"][1] then
  95. if types[monData["Type"][1]] then
  96. type1.Value = types[monData["Type"][1]]
  97. else
  98. type1.Value = 0
  99. appendErr(name.." has no Type1 due to invalid type value at index 1")
  100. end
  101. else
  102. type1.Value = 0
  103. appendErr(name.." has no Type1 due to no type value at index 1")
  104. end
  105. else
  106. type1.Value = 0
  107. appendErr(name.." has no Type1 due to no type array")
  108. end
  109. type1.Parent = ssos
  110.  
  111. --[[ Type2 ]]--
  112. local type2 = Instance.new("NumberValue")
  113. type2.Name = "Type2"
  114. if monData["Type"] then
  115. if monData["Type"][2] then
  116. if types[monData["Type"][1]] then
  117. type2.Value = types[monData["Type"][2]]
  118. else
  119. type2.Value = 0
  120. appendErr(name.." has no Type2 due to invalid type value at index 2")
  121. end
  122. else
  123. type2.Value = 0
  124. appendErr(name.." has no Type2 due to no type value at index 2")
  125. end
  126. else
  127. type2.Value = 0
  128. appendErr(name.." has no Type2 due to no type array")
  129. end
  130. type2.Parent = ssos
  131.  
  132. --[[ Map Hazard Immunities ]]--
  133. if monData["Immunity"] then
  134. for i, immunityType in pairs(monData["Immunity"]) do
  135. local immunity = Instance.new("NumberValue")
  136. immunity.Name = immunityType
  137. immunity.Value = 1
  138. immunity.Parent = ssos
  139. end
  140. end
  141.  
  142. ssos.Parent = monFolder
  143.  
  144.  
  145.  
  146. --[[ WEAPONS ]]--
  147. local weapons = Instance.new("Folder")
  148. weapons.Name = "Weapons"
  149. if monData["Weapons"] then
  150. for i, weaponName in pairs(monData["Weapons"]) do
  151. if weaponName and weaponName~="aaa" then
  152. local weapon = Instance.new("StringValue")
  153. weapon.Name = "Weapon"..i
  154. weapon.Value = weaponName
  155. weapon.Parent = weapons
  156. end
  157. end
  158. else
  159. appendErr(name.." has no weapons")
  160. end
  161.  
  162. weapons.Parent = monFolder
  163.  
  164.  
  165.  
  166. --[[ STATS ]]--
  167.  
  168. --[[ Health ]]--
  169. local health = Instance.new("NumberValue")
  170. health.Name = "Health"
  171. if monData["Stats"] then
  172. if monData["Stats"][1] then
  173. health.Value = monData["Stats"][1]
  174. else
  175. health.Value = 400
  176. appendErr(name.." has no Health due to no stat value at index 1 (defaulted to 400)")
  177. end
  178. else
  179. health.Value = 400
  180. appendErr(name.." has no Health due to no stat array (defaulted to 400)")
  181. end
  182.  
  183. health.Parent = monFolder
  184.  
  185. --[[ Speed ]]--
  186. local speed = Instance.new("NumberValue")
  187. speed.Name = "Speed"
  188. if monData["Stats"] then
  189. if monData["Stats"][2] then
  190. speed.Value = monData["Stats"][2]
  191. else
  192. speed.Value = 70
  193. appendErr(name.." has no Speed due to no stat value at index 1 (defaulted to 70)")
  194. end
  195. else
  196. speed.Value = 70
  197. appendErr(name.." has no Speed due to no stat array (defaulted to 70)")
  198. end
  199.  
  200. speed.Parent = monFolder
  201.  
  202. --[[ Jump]]--
  203. local jump = Instance.new("NumberValue")
  204. jump.Name = "JumpPower"
  205. if monData["Stats"] then
  206. if monData["Stats"][3] then
  207. jump.Value = monData["Stats"][3]
  208. else
  209. jump.Value = 50
  210. appendErr(name.." has no JumpPower due to no stat value at index 1 (defaulted to 50)")
  211. end
  212. else
  213. jump.Value = 50
  214. appendErr(name.." has no JumpPower due to no stat array (defaulted to 50)")
  215. end
  216.  
  217. jump.Parent = monFolder
  218.  
  219. --[[ Stage-Specific Stats (ImageId and Stat, or Need and MegaEvolution) ]]--
  220. if isEvolution then
  221.  
  222. if monData["FirstStageStats"] then
  223. --[[appendNorm(name.." has FirstStageStats (will go unused)")]]
  224. end
  225. if monData["EvoStageStats"] then
  226. if monData["EvoStageStats"][1] then
  227. local need = Instance.new("StringValue")
  228. need.Name = "Need"
  229. need.Value = monData["EvoStageStats"][1]
  230. need.Parent = monFolder
  231. appendNorm(name.." Need set to "..monData["EvoStageStats"][1])
  232. else
  233. appendNorm(name.." has no Need due to no stat value at index 1")
  234. end
  235. if monData["EvoStageStats"][2] then
  236. local megaEvo = Instance.new("BoolValue")
  237. megaEvo.Name = "MegaEvolution"
  238. megaEvo.Value = true
  239. megaEvo.Parent = monFolder
  240. appendNorm(name.." is a Mega Evolution")
  241. end
  242. else
  243. appendErr(name.." has no Need (or MegaEvolution) due to no stat array")
  244. end
  245.  
  246. else
  247.  
  248. if monData["EvoStageStats"] then
  249. --[[appendNorm(name.." has EvoStageStats (will go unused)")]]
  250. end
  251. local stat = Instance.new("StringValue")
  252. stat.Name = "Stat"
  253. if monData["FirstStageStats"] then
  254. if monData["FirstStageStats"][1] then
  255. stat.Value = monData["FirstStageStats"][1]
  256. appendNorm(name.." Stat set to "..monData["FirstStageStats"][1])
  257. else
  258. stat.Value = name
  259. --[[appendNorm(name.." has no Stat due to no stat value at index 1 (defaulted to its name)")]]
  260. end
  261. if monData["FirstStageStats"][2] then
  262. local imageId = Instance.new("StringValue")
  263. imageId.Name = "ImageId"
  264. imageId.Value = monData["FirstStageStats"][2]
  265. imageId.Parent = monFolder
  266. else
  267. appendErr(name.." has no ImageId")
  268. end
  269. else
  270. stat.Value = name
  271. appendErr(name.." has no Stat (or ImageId) due to no stat array (stat defaulted to its name)")
  272. end
  273. appendStat(stat.Value)
  274. stat.Parent = monFolder
  275.  
  276. end
  277.  
  278. return monFolder
  279. end
  280.  
  281.  
  282.  
  283.  
  284.  
  285. local function constructEvoLine(monData, isEvolution)
  286. local thisMon = constructMon(monData, isEvolution)
  287. local localHierarchy = thisMon.Name
  288.  
  289. if monData["Evos"] then
  290. localHierarchy = localHierarchy.." > ("
  291. for i, evoData in pairs(monData["Evos"]) do
  292. local thisEvo = constructEvoLine(evoData, true)
  293. thisEvo[1].Parent = thisMon
  294. localHierarchy = localHierarchy..thisEvo[2]
  295. end
  296. localHierarchy = localHierarchy..")"
  297. end
  298.  
  299. return {thisMon, localHierarchy}
  300. end
  301.  
  302.  
  303. local directory = Instance.new("Folder")
  304. directory.Name = "Auto-Generated Mons"
  305. directory.Parent = putDirectoryIn
  306.  
  307.  
  308. for i, baseMon in pairs(newMons) do
  309. local thisEvoLine = constructEvoLine(baseMon, false)
  310. thisEvoLine[1].Parent = directory
  311. hierarchy = hierarchy..thisEvoLine[2].."\n"
  312. end
  313.  
  314. print(hierarchy.."\n")
  315. print(fullNormalMessage.."\n")
  316. print(fullErrorMessage.."\n")
  317. print(statsToPaste)
  318.  
  319.  
  320. end
  321.  
  322. return doThat
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356. --[==[
  357. Here is an example of how to write the newMons!
  358.  
  359.  
  360.  
  361. local newMons = {
  362.  
  363.  
  364.  
  365. {
  366. ["Name"] = "Jirachi",
  367. --[[ setstatsonspawn ]]--
  368. ["Type"] = {"Steel", "Psychic"},
  369. ["Immunity"] = nil,
  370. --[[ ["CPKMN"] = current_pokemon, (only include this if you need a custom value) ]]--
  371. --[[ weapons ]]--
  372. ["Weapons"] = {"DoomDesire", "ZenHeadbutt", "DazzlingGleam", "CosmicPower"},
  373. --[[ other ]]--
  374. ["Stats"] = {500, 100, 75},
  375. ["FirstStageStats"] = {nil, 17738417033},
  376. ["EvoStageStats"] = {nil, false},
  377. ["Evos"] = {
  378. nil
  379. }
  380. },
  381.  
  382.  
  383.  
  384. {
  385. ["Name"] = "Electrike",
  386. --[[ setstatsonspawn ]]--
  387. ["Type"] = {"Electric", "None"},
  388. ["Immunity"] = nil,
  389. --[[ ["CPKMN"] = current_pokemon, (only include this if you need a custom value) ]]--
  390. --[[ weapons ]]--
  391. ["Weapons"] = {"Spark", "Bite", "aaa", "aaa"},
  392. --[[ other ]]--
  393. ["Stats"] = {100, 60, 50},
  394. ["FirstStageStats"] = {nil, 17738476079},
  395. ["EvoStageStats"] = {nil, false},
  396. ["Evos"] = {
  397. {
  398. ["Name"] = "Manectric",
  399. --[[ setstatsonspawn ]]--
  400. ["Type"] = {"Electric", "None"},
  401. ["Immunity"] = nil,
  402. --[[ ["CPKMN"] = current_pokemon, (only include this if you need a custom value) ]]--
  403. --[[ weapons ]]--
  404. ["Weapons"] = {"Spark", "Bite", "Thunderbolt", "WildCharge"},
  405. --[[ other ]]--
  406. ["Stats"] = {300, 90, 50},
  407. ["FirstStageStats"] = {nil, 17738476079},
  408. ["EvoStageStats"] = {"LVL*26", false},
  409. ["Evos"] = {
  410. {
  411. ["Name"] = "Mega Manectric",
  412. --[[ setstatsonspawn ]]--
  413. ["Type"] = {"Electric", "None"},
  414. ["Immunity"] = {"Fire"},
  415. --[[ ["CPKMN"] = current_pokemon, (only include this if you need a custom value) ]]--
  416. --[[ weapons ]]--
  417. ["Weapons"] = {"Flamethrower", "Crunch", "Thunderbolt", "WildCharge"},
  418. --[[ other ]]--
  419. ["Stats"] = {490, 130, 50},
  420. ["FirstStageStats"] = {nil, 17738476079},
  421. ["EvoStageStats"] = {"C*Manectite*1", true},
  422. ["Evos"] = {
  423. nil
  424. }
  425. },
  426. }
  427. },
  428. }
  429. },
  430.  
  431.  
  432.  
  433. {
  434. ["Name"] ="Ralts",
  435. --[[ setstatsonspawn ]]--
  436. ["Type"] = {"Psychic", "Fairy"},
  437. --[[ weapons ]]--
  438. ["Weapons"] = {"Psybeam", "Teleport", "aaa", "aaa"},
  439. --[[ other ]]--
  440. ["Stats"] = {90, 40, 50},
  441. ["FirstStageStats"] = {nil, 17248914865},
  442. ["EvoStageStats"] = {"LVL*16", false},
  443. ["Evos"] = {
  444. {
  445. ["Name"] ="Kirlia",
  446. --[[ setstatsonspawn ]]--
  447. ["Type"] = {"Psychic", "Fairy"},
  448. --[[ weapons ]]--
  449. ["Weapons"] = {"Psybeam", "Teleport", "FutureSight", "aaa"},
  450. --[[ other ]]--
  451. ["Stats"] = {230, 50, 50},
  452. ["FirstStageStats"] = {nil, 17248914438},
  453. ["EvoStageStats"] = {"LVL*20", false},
  454. ["Evos"] = {
  455. {
  456. ["Name"] ="Gardevoir",
  457. --[[ setstatsonspawn ]]--
  458. ["Type"] = {"Psychic", "Fairy"},
  459. --[[ weapons ]]--
  460. ["Weapons"] = {"Psybeam", "Teleport", "FutureSight", "Moonblast"},
  461. --[[ other ]]--
  462. ["Stats"] = {450, 80, 50},
  463. ["FirstStageStats"] = {nil, 17248914438},
  464. ["EvoStageStats"] = {"LVL*30", false},
  465. ["Evos"] = {
  466. {
  467. ["Name"] ="Mega Gardevoir",
  468. --[[ setstatsonspawn ]]--
  469. ["Type"] = {"Psychic", "Fairy"},
  470. --[[ weapons ]]--
  471. ["Weapons"] = {"Psychic", "DrainingKiss", "FutureSight", "Moonblast"},
  472. --[[ other ]]--
  473. ["Stats"] = {520, 100, 50},
  474. ["FirstStageStats"] = {nil, 17248914438},
  475. ["EvoStageStats"] = {"C*Gardevoirite*1", true},
  476. ["Evos"] = {
  477. nil
  478. }
  479. }
  480. }
  481. },
  482.  
  483. {
  484. ["Name"] ="Gallade",
  485. --[[ setstatsonspawn ]]--
  486. ["Type"] = {"Psychic", "Fighting"},
  487. --[[ weapons ]]--
  488. ["Weapons"] = {"Psybeam", "Teleport", "FutureSight", "LeafBlade"},
  489. --[[ other ]]--
  490. ["Stats"] = {450, 80, 50},
  491. ["FirstStageStats"] = {nil, 17248914438},
  492. ["EvoStageStats"] = {"C*DawnStone*1", false},
  493. ["Evos"] = {
  494. {
  495. ["Name"] ="Mega Gallade",
  496. --[[ setstatsonspawn ]]--
  497. ["Type"] = {"Psychic", "Fighting"},
  498. --[[ weapons ]]--
  499. ["Weapons"] = {"Psychic", "SacredSword", "FutureSight", "LeafBlade"},
  500. --[[ other ]]--
  501. ["Stats"] = {530, 110, 50},
  502. ["FirstStageStats"] = {nil, 17248914438},
  503. ["EvoStageStats"] = {"C*Galladite*1", true},
  504. ["Evos"] = {
  505. nil
  506. }
  507. }
  508. }
  509. }
  510. }
  511. }
  512. }
  513. },
  514.  
  515.  
  516.  
  517. {
  518. ["Name"] ="Poliwag",
  519. --[[ setstatsonspawn ]]--
  520. ["Type"] = {"Water", "None"},
  521. --[[ weapons ]]--
  522. ["Weapons"] = {"BodySlam", "Hypnosis", "aaa", "aaa"},
  523. --[[ other ]]--
  524. ["Stats"] = {120, 90, 50},
  525. ["FirstStageStats"] = {nil, 17248914865},
  526. ["EvoStageStats"] = {"LVL*16", false},
  527. ["Evos"] = {
  528. {
  529. ["Name"] ="Poliwhirl",
  530. --[[ setstatsonspawn ]]--
  531. ["Type"] = {"Water", "None"},
  532. --[[ weapons ]]--
  533. ["Weapons"] = {"BodySlam", "Hypnosis", "HydroPump", "aaa"},
  534. --[[ other ]]--
  535. ["Stats"] = {290, 90, 50},
  536. ["FirstStageStats"] = {nil, 17248914438},
  537. ["EvoStageStats"] = {"LVL*25", false},
  538. ["Evos"] = {
  539. {
  540. ["Name"] ="Poliwrath",
  541. --[[ setstatsonspawn ]]--
  542. ["Type"] = {"Water", "Fighting"},
  543. --[[ weapons ]]--
  544. ["Weapons"] = {"BodySlam", "Hypnosis", "HydroPump", "Submission"},
  545. --[[ other ]]--
  546. ["Stats"] = {480, 70, 50},
  547. ["FirstStageStats"] = {nil, 17248914438},
  548. ["EvoStageStats"] = {"C*WaterStone*1", false},
  549. ["Evos"] = {
  550. nil
  551. }
  552. },
  553.  
  554. {
  555. ["Name"] ="Politoed",
  556. --[[ setstatsonspawn ]]--
  557. ["Type"] = {"Water", "None"},
  558. --[[ weapons ]]--
  559. ["Weapons"] = {"BodySlam", "Hypnosis", "HydroPump", "Surf"},
  560. --[[ other ]]--
  561. ["Stats"] = {470, 70, 50},
  562. ["FirstStageStats"] = {nil, 17248914438},
  563. ["EvoStageStats"] = {"C*KingRock*1|C*TradeLink*1", false},
  564. ["Evos"] = {
  565. nil
  566. }
  567. }
  568. }
  569. }
  570. }
  571. }
  572. }
  573.  
  574. ]==]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement