Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function doThat()
- local putDirectoryIn = game.StarterGui.GameGui.LocalScript.Pokemon
- --[==[
- local newMons = {
- {
- ["Name"] = Name,
- --[[ setstatsonspawn ]]--
- ["Type"] = {Type1, Type2},
- ["Immunity"] = {immunity1, immunity2, etc (e.g. Fire)},
- --[[ ["CPKMN"] = current_pokemon, (only include this if you need a custom value) ]]--
- --[[ weapons ]]--
- ["Weapons"] = {Move1, Move2, Move3, Move4},
- --[[ other ]]--
- ["Stats"] = {Health, Speed, Jump},
- ["FirstStageStats"] = {Stat, ImageId},
- ["EvoStageStats"] = {Need, Mega},
- ["Evos"] = {
- blah
- }
- },
- blah
- }
- ]==]--
- local newMons = {
- }
- 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}
- local hierarchy = "Success! Created the following lines:\n"
- local fullNormalMessage = "Probably normal:\n"
- local fullErrorMessage = "Possible errors:\n"
- local statsToPaste = "To paste in StarterData:\n"
- local function appendNorm(message)
- fullNormalMessage = fullNormalMessage..message.."\n"
- end
- local function appendErr(message)
- fullErrorMessage = fullErrorMessage..message.."\n"
- end
- local function appendStat(stat)
- 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}"
- end
- local function constructMon(monData, isEvolution)
- local name = monData["Name"]
- local monFolder = Instance.new("Folder")
- monFolder.Name = name
- --[[ SETSTATSONSPAWN ]]--
- local ssos = Instance.new("Folder")
- ssos.Name = "SetStatsOnSpawn"
- --[[ Current_Pokemon ]]--
- local cpkmn = Instance.new("StringValue")
- cpkmn.Name = "Current_Pokemon"
- if monData["CPKMN"] then
- cpkmn.Value = monData["CPKMN"]
- appendNorm(name.." Current_Pokemon value set to "..monData["CPKMN"])
- else
- cpkmn.Value = name
- end
- cpkmn.Parent = ssos
- --[[ IncreaseHealth ]]--
- local incHealth = Instance.new("NumberValue")
- incHealth.Name = "IncreaseHealth"
- incHealth.Value = 1
- incHealth.Parent = ssos
- --[[ Type1 ]]--
- local type1 = Instance.new("NumberValue")
- type1.Name = "Type"
- if monData["Type"] then
- if monData["Type"][1] then
- if types[monData["Type"][1]] then
- type1.Value = types[monData["Type"][1]]
- else
- type1.Value = 0
- appendErr(name.." has no Type1 due to invalid type value at index 1")
- end
- else
- type1.Value = 0
- appendErr(name.." has no Type1 due to no type value at index 1")
- end
- else
- type1.Value = 0
- appendErr(name.." has no Type1 due to no type array")
- end
- type1.Parent = ssos
- --[[ Type2 ]]--
- local type2 = Instance.new("NumberValue")
- type2.Name = "Type2"
- if monData["Type"] then
- if monData["Type"][2] then
- if types[monData["Type"][1]] then
- type2.Value = types[monData["Type"][2]]
- else
- type2.Value = 0
- appendErr(name.." has no Type2 due to invalid type value at index 2")
- end
- else
- type2.Value = 0
- appendErr(name.." has no Type2 due to no type value at index 2")
- end
- else
- type2.Value = 0
- appendErr(name.." has no Type2 due to no type array")
- end
- type2.Parent = ssos
- --[[ Map Hazard Immunities ]]--
- if monData["Immunity"] then
- for i, immunityType in pairs(monData["Immunity"]) do
- local immunity = Instance.new("NumberValue")
- immunity.Name = immunityType
- immunity.Value = 1
- immunity.Parent = ssos
- end
- end
- ssos.Parent = monFolder
- --[[ WEAPONS ]]--
- local weapons = Instance.new("Folder")
- weapons.Name = "Weapons"
- if monData["Weapons"] then
- for i, weaponName in pairs(monData["Weapons"]) do
- if weaponName and weaponName~="aaa" then
- local weapon = Instance.new("StringValue")
- weapon.Name = "Weapon"..i
- weapon.Value = weaponName
- weapon.Parent = weapons
- end
- end
- else
- appendErr(name.." has no weapons")
- end
- weapons.Parent = monFolder
- --[[ STATS ]]--
- --[[ Health ]]--
- local health = Instance.new("NumberValue")
- health.Name = "Health"
- if monData["Stats"] then
- if monData["Stats"][1] then
- health.Value = monData["Stats"][1]
- else
- health.Value = 400
- appendErr(name.." has no Health due to no stat value at index 1 (defaulted to 400)")
- end
- else
- health.Value = 400
- appendErr(name.." has no Health due to no stat array (defaulted to 400)")
- end
- health.Parent = monFolder
- --[[ Speed ]]--
- local speed = Instance.new("NumberValue")
- speed.Name = "Speed"
- if monData["Stats"] then
- if monData["Stats"][2] then
- speed.Value = monData["Stats"][2]
- else
- speed.Value = 70
- appendErr(name.." has no Speed due to no stat value at index 1 (defaulted to 70)")
- end
- else
- speed.Value = 70
- appendErr(name.." has no Speed due to no stat array (defaulted to 70)")
- end
- speed.Parent = monFolder
- --[[ Jump]]--
- local jump = Instance.new("NumberValue")
- jump.Name = "JumpPower"
- if monData["Stats"] then
- if monData["Stats"][3] then
- jump.Value = monData["Stats"][3]
- else
- jump.Value = 50
- appendErr(name.." has no JumpPower due to no stat value at index 1 (defaulted to 50)")
- end
- else
- jump.Value = 50
- appendErr(name.." has no JumpPower due to no stat array (defaulted to 50)")
- end
- jump.Parent = monFolder
- --[[ Stage-Specific Stats (ImageId and Stat, or Need and MegaEvolution) ]]--
- if isEvolution then
- if monData["FirstStageStats"] then
- --[[appendNorm(name.." has FirstStageStats (will go unused)")]]
- end
- if monData["EvoStageStats"] then
- if monData["EvoStageStats"][1] then
- local need = Instance.new("StringValue")
- need.Name = "Need"
- need.Value = monData["EvoStageStats"][1]
- need.Parent = monFolder
- appendNorm(name.." Need set to "..monData["EvoStageStats"][1])
- else
- appendNorm(name.." has no Need due to no stat value at index 1")
- end
- if monData["EvoStageStats"][2] then
- local megaEvo = Instance.new("BoolValue")
- megaEvo.Name = "MegaEvolution"
- megaEvo.Value = true
- megaEvo.Parent = monFolder
- appendNorm(name.." is a Mega Evolution")
- end
- else
- appendErr(name.." has no Need (or MegaEvolution) due to no stat array")
- end
- else
- if monData["EvoStageStats"] then
- --[[appendNorm(name.." has EvoStageStats (will go unused)")]]
- end
- local stat = Instance.new("StringValue")
- stat.Name = "Stat"
- if monData["FirstStageStats"] then
- if monData["FirstStageStats"][1] then
- stat.Value = monData["FirstStageStats"][1]
- appendNorm(name.." Stat set to "..monData["FirstStageStats"][1])
- else
- stat.Value = name
- --[[appendNorm(name.." has no Stat due to no stat value at index 1 (defaulted to its name)")]]
- end
- if monData["FirstStageStats"][2] then
- local imageId = Instance.new("StringValue")
- imageId.Name = "ImageId"
- imageId.Value = monData["FirstStageStats"][2]
- imageId.Parent = monFolder
- else
- appendErr(name.." has no ImageId")
- end
- else
- stat.Value = name
- appendErr(name.." has no Stat (or ImageId) due to no stat array (stat defaulted to its name)")
- end
- appendStat(stat.Value)
- stat.Parent = monFolder
- end
- return monFolder
- end
- local function constructEvoLine(monData, isEvolution)
- local thisMon = constructMon(monData, isEvolution)
- local localHierarchy = thisMon.Name
- if monData["Evos"] then
- localHierarchy = localHierarchy.." > ("
- for i, evoData in pairs(monData["Evos"]) do
- local thisEvo = constructEvoLine(evoData, true)
- thisEvo[1].Parent = thisMon
- localHierarchy = localHierarchy..thisEvo[2]
- end
- localHierarchy = localHierarchy..")"
- end
- return {thisMon, localHierarchy}
- end
- local directory = Instance.new("Folder")
- directory.Name = "Auto-Generated Mons"
- directory.Parent = putDirectoryIn
- for i, baseMon in pairs(newMons) do
- local thisEvoLine = constructEvoLine(baseMon, false)
- thisEvoLine[1].Parent = directory
- hierarchy = hierarchy..thisEvoLine[2].."\n"
- end
- print(hierarchy.."\n")
- print(fullNormalMessage.."\n")
- print(fullErrorMessage.."\n")
- print(statsToPaste)
- end
- return doThat
- --[==[
- Here is an example of how to write the newMons!
- local newMons = {
- {
- ["Name"] = "Jirachi",
- --[[ setstatsonspawn ]]--
- ["Type"] = {"Steel", "Psychic"},
- ["Immunity"] = nil,
- --[[ ["CPKMN"] = current_pokemon, (only include this if you need a custom value) ]]--
- --[[ weapons ]]--
- ["Weapons"] = {"DoomDesire", "ZenHeadbutt", "DazzlingGleam", "CosmicPower"},
- --[[ other ]]--
- ["Stats"] = {500, 100, 75},
- ["FirstStageStats"] = {nil, 17738417033},
- ["EvoStageStats"] = {nil, false},
- ["Evos"] = {
- nil
- }
- },
- {
- ["Name"] = "Electrike",
- --[[ setstatsonspawn ]]--
- ["Type"] = {"Electric", "None"},
- ["Immunity"] = nil,
- --[[ ["CPKMN"] = current_pokemon, (only include this if you need a custom value) ]]--
- --[[ weapons ]]--
- ["Weapons"] = {"Spark", "Bite", "aaa", "aaa"},
- --[[ other ]]--
- ["Stats"] = {100, 60, 50},
- ["FirstStageStats"] = {nil, 17738476079},
- ["EvoStageStats"] = {nil, false},
- ["Evos"] = {
- {
- ["Name"] = "Manectric",
- --[[ setstatsonspawn ]]--
- ["Type"] = {"Electric", "None"},
- ["Immunity"] = nil,
- --[[ ["CPKMN"] = current_pokemon, (only include this if you need a custom value) ]]--
- --[[ weapons ]]--
- ["Weapons"] = {"Spark", "Bite", "Thunderbolt", "WildCharge"},
- --[[ other ]]--
- ["Stats"] = {300, 90, 50},
- ["FirstStageStats"] = {nil, 17738476079},
- ["EvoStageStats"] = {"LVL*26", false},
- ["Evos"] = {
- {
- ["Name"] = "Mega Manectric",
- --[[ setstatsonspawn ]]--
- ["Type"] = {"Electric", "None"},
- ["Immunity"] = {"Fire"},
- --[[ ["CPKMN"] = current_pokemon, (only include this if you need a custom value) ]]--
- --[[ weapons ]]--
- ["Weapons"] = {"Flamethrower", "Crunch", "Thunderbolt", "WildCharge"},
- --[[ other ]]--
- ["Stats"] = {490, 130, 50},
- ["FirstStageStats"] = {nil, 17738476079},
- ["EvoStageStats"] = {"C*Manectite*1", true},
- ["Evos"] = {
- nil
- }
- },
- }
- },
- }
- },
- {
- ["Name"] ="Ralts",
- --[[ setstatsonspawn ]]--
- ["Type"] = {"Psychic", "Fairy"},
- --[[ weapons ]]--
- ["Weapons"] = {"Psybeam", "Teleport", "aaa", "aaa"},
- --[[ other ]]--
- ["Stats"] = {90, 40, 50},
- ["FirstStageStats"] = {nil, 17248914865},
- ["EvoStageStats"] = {"LVL*16", false},
- ["Evos"] = {
- {
- ["Name"] ="Kirlia",
- --[[ setstatsonspawn ]]--
- ["Type"] = {"Psychic", "Fairy"},
- --[[ weapons ]]--
- ["Weapons"] = {"Psybeam", "Teleport", "FutureSight", "aaa"},
- --[[ other ]]--
- ["Stats"] = {230, 50, 50},
- ["FirstStageStats"] = {nil, 17248914438},
- ["EvoStageStats"] = {"LVL*20", false},
- ["Evos"] = {
- {
- ["Name"] ="Gardevoir",
- --[[ setstatsonspawn ]]--
- ["Type"] = {"Psychic", "Fairy"},
- --[[ weapons ]]--
- ["Weapons"] = {"Psybeam", "Teleport", "FutureSight", "Moonblast"},
- --[[ other ]]--
- ["Stats"] = {450, 80, 50},
- ["FirstStageStats"] = {nil, 17248914438},
- ["EvoStageStats"] = {"LVL*30", false},
- ["Evos"] = {
- {
- ["Name"] ="Mega Gardevoir",
- --[[ setstatsonspawn ]]--
- ["Type"] = {"Psychic", "Fairy"},
- --[[ weapons ]]--
- ["Weapons"] = {"Psychic", "DrainingKiss", "FutureSight", "Moonblast"},
- --[[ other ]]--
- ["Stats"] = {520, 100, 50},
- ["FirstStageStats"] = {nil, 17248914438},
- ["EvoStageStats"] = {"C*Gardevoirite*1", true},
- ["Evos"] = {
- nil
- }
- }
- }
- },
- {
- ["Name"] ="Gallade",
- --[[ setstatsonspawn ]]--
- ["Type"] = {"Psychic", "Fighting"},
- --[[ weapons ]]--
- ["Weapons"] = {"Psybeam", "Teleport", "FutureSight", "LeafBlade"},
- --[[ other ]]--
- ["Stats"] = {450, 80, 50},
- ["FirstStageStats"] = {nil, 17248914438},
- ["EvoStageStats"] = {"C*DawnStone*1", false},
- ["Evos"] = {
- {
- ["Name"] ="Mega Gallade",
- --[[ setstatsonspawn ]]--
- ["Type"] = {"Psychic", "Fighting"},
- --[[ weapons ]]--
- ["Weapons"] = {"Psychic", "SacredSword", "FutureSight", "LeafBlade"},
- --[[ other ]]--
- ["Stats"] = {530, 110, 50},
- ["FirstStageStats"] = {nil, 17248914438},
- ["EvoStageStats"] = {"C*Galladite*1", true},
- ["Evos"] = {
- nil
- }
- }
- }
- }
- }
- }
- }
- },
- {
- ["Name"] ="Poliwag",
- --[[ setstatsonspawn ]]--
- ["Type"] = {"Water", "None"},
- --[[ weapons ]]--
- ["Weapons"] = {"BodySlam", "Hypnosis", "aaa", "aaa"},
- --[[ other ]]--
- ["Stats"] = {120, 90, 50},
- ["FirstStageStats"] = {nil, 17248914865},
- ["EvoStageStats"] = {"LVL*16", false},
- ["Evos"] = {
- {
- ["Name"] ="Poliwhirl",
- --[[ setstatsonspawn ]]--
- ["Type"] = {"Water", "None"},
- --[[ weapons ]]--
- ["Weapons"] = {"BodySlam", "Hypnosis", "HydroPump", "aaa"},
- --[[ other ]]--
- ["Stats"] = {290, 90, 50},
- ["FirstStageStats"] = {nil, 17248914438},
- ["EvoStageStats"] = {"LVL*25", false},
- ["Evos"] = {
- {
- ["Name"] ="Poliwrath",
- --[[ setstatsonspawn ]]--
- ["Type"] = {"Water", "Fighting"},
- --[[ weapons ]]--
- ["Weapons"] = {"BodySlam", "Hypnosis", "HydroPump", "Submission"},
- --[[ other ]]--
- ["Stats"] = {480, 70, 50},
- ["FirstStageStats"] = {nil, 17248914438},
- ["EvoStageStats"] = {"C*WaterStone*1", false},
- ["Evos"] = {
- nil
- }
- },
- {
- ["Name"] ="Politoed",
- --[[ setstatsonspawn ]]--
- ["Type"] = {"Water", "None"},
- --[[ weapons ]]--
- ["Weapons"] = {"BodySlam", "Hypnosis", "HydroPump", "Surf"},
- --[[ other ]]--
- ["Stats"] = {470, 70, 50},
- ["FirstStageStats"] = {nil, 17248914438},
- ["EvoStageStats"] = {"C*KingRock*1|C*TradeLink*1", false},
- ["Evos"] = {
- nil
- }
- }
- }
- }
- }
- }
- }
- ]==]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement