local function ShinyName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Shiny") then
local newName = tostring(getCreatureName(cid)):match("Shiny (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function MegaName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Mega") then
local newName = tostring(getCreatureName(cid)):match("Mega (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function GiantName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Shiny Giant") then
local newName = tostring(getCreatureName(cid)):match("Shiny Giant (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function LightName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Light") then
local newName = tostring(getCreatureName(cid)):match("Light (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function AncienttName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Ancientt") then
local newName = tostring(getCreatureName(cid)):match("Ancientt (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function GhostName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Ghost") then
local newName = tostring(getCreatureName(cid)):match("Ghost (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function WaterName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Water") then
local newName = tostring(getCreatureName(cid)):match("Water (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function FireName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Fire") then
local newName = tostring(getCreatureName(cid)):match("Fire (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function IceName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Ice") then
local newName = tostring(getCreatureName(cid)):match("Ice (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function FlyingName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Flying") then
local newName = tostring(getCreatureName(cid)):match("Flying (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function GrassName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Grass") then
local newName = tostring(getCreatureName(cid)):match("Grass (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function doSetRandomGender(cid)
if not isCreature(cid) then return true end
if isSummon(cid) then return true end
local gender = 0
local name = getCreatureName(cid)
if not newpokedex[name] then return true end
local rate = newpokedex[name].gender
if rate == 0 then
gender = 3
elseif rate == 1000 then
gender = 4
elseif rate == -1 then
gender = 0
elseif math.random(1, 1000) <= rate then
gender = 4
else
gender = 3
end
doCreatureSetSkullType(cid, gender)
end
local function doShiny(cid)
if isCreature(cid) then
if isSummon(cid) then return true end
if getPlayerStorageValue(cid, 74469) >= 1 then return true end
if getPlayerStorageValue(cid, 22546) >= 1 then return true end
if isNpcSummon(cid) then return true end
if getPlayerStorageValue(cid, 637500) >= 1 then return true end
if isInArray(shinys, getCreatureName(cid)) then
chance = 3
elseif isInArray(raros, getCreatureName(cid)) then
chance = 3
elseif isInArray(new, getCreatureName(cid)) then
chance = 3
else
return true
end
if math.random(1, 1000) <= chance*10 then
doSendMagicEffect(getThingPos(cid), 18)
local name, pos = "Shiny ".. getCreatureName(cid), getThingPos(cid)
doRemoveCreature(cid)
local shi = doCreateMonster(name, pos, false)
setPlayerStorageValue(shi, 74469, 1)
else
setPlayerStorageValue(cid, 74469, 1)
end
else
return true
end
end
if isSummon(cid) then
registerCreatureEvent(cid, "SummonDeath")
return true
end
addEvent(function()
if isCreature(cid) then
if isInArray(specialSummon.pokes[2], getCreatureName(cid)) then
if math.random(1, 10000) <= specialSummon.chance*10 then
local position = getThingPos(cid)
doRemoveCreature(cid)
doCreateMonster(specialSummon.pokes[1][math.random(#specialSummon.pokes[1])], position)
end
end
end
addEvent(function()
if isCreature(cid) then
if isInArray(outlandSpawn.pokes[2], getCreatureName(cid)) then
if math.random(1, 10000) <= outlandSpawn.chance*10 then
local position = getThingPos(cid)
doRemoveCreature(cid)
doCreateMonster(outlandSpawn.pokes[1][math.random(#outlandSpawn.pokes[1])], position)
end
end
end
end, 15)
addEvent(doSetRandomGender, 5, cid)
addEvent(doShiny, 10, cid)
addEvent(ShinyName, 15, cid)
addEvent(MegaName, 15, cid)
addEvent(LightName, 15, cid)
addEvent(AncienttName, 15, cid)
addEvent(GhostName, 15, cid)
addEvent(WaterName, 15, cid)
addEvent(FireName, 15, cid)
addEvent(IceName, 15, cid)
addEvent(FlyingName, 15, cid)
addEvent(GrassName, 15, cid)
addEvent(GiantName, 15, cid)
addEvent(adjustWildPoke, 5, cid)
return true
end
[31/08/2018 02:24:19] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/spawn.lua:14: '}' expected (to close '{' at line 8) near 'local'
[31/08/2018 02:24:19] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/spawn.lua)
[31/08/2018 02:24:19] data/creaturescripts/scripts/spawn.lua:14: '}' expected (to close '{' at line 8) near 'local'
Pergunta
FlamesAdmin 261
alguem por favor poderia arrumar meu spawn.lua?
local shinys = {
"Oddish", "Venusaur", "Charizard", "Blastoise", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Zubat", "Golbat", "Paras", "Parasect",
"Venonat", "Venomoth", "Growlithe", "Arcanine", "Alakazam", "Tentacool", "Tentacruel", "Farfetch'd", "Grimer", "Muk", "Gengar", "Krabby",
"Kingler", "Voltorb", "Electrode", "Cubone", "Marowak", "Tangela", "Horsea", "Seadra", "Scyther", "Jynx", "Electabuzz", "Pinsir",
"Magikarp", "Magmar", "Typhlosion", "Feraligatr", "Meganium", "Xatu", "Machamp", "Tauros", "Larvitar", "Pupitar", "Ampharos", "Magcargo", "Lanturn"}
local raros = {"Dragonair", "Dratini", "Dragonite", "Gyarados"}
local new = {"Lanturn"}
local specialSummon = {
chance = 1,
pokes = {
{"Milotic", "Electivire", "Magmortar", "Metagross", "Tangrowth", "Slaking", "Rhyperior"},
{"Manectric", "Camerupt", "Blaziken", "Sceptile", "Swampert", "Glalie", "Flygon", "Kirlia", "Lairon", "Lucario", "Metang", "Ludicolo", "Banette", "Claydol", "Swellow", "Altaria", "Mawile"},
}
local outlandSpawn = {
chance = 500,
pokes = {
{"Zapdos", "Moltres", "Mew", "Mewtwo", "Articuno", "Entei", "Raikou", "Suicune"},
{"Boxer Hitmonchan", "Capoeira Hitmontop", "Dragon Machamp", "Undefeated Machamp", "Tribal Feraligatr", "War Gyarados", "Brave Blastoise", "Furious Mantine", "Octopus Octillery", "Ancient Alakazam", "Tribal Xatu", "Enigmatic Girafarig", "Furious Girafarig", "Furious Scyther", "War Pinsir", "War Heracross", "Brute Rhydon", "Hard Golem", "Bone Marowak", "Furious Sandslash", "Roll Donphan", "Ancient Meeganium", "Brave Venusaur", "Charged Raichu", "Furious Ampharos", "Magnet Electabuzz", "Brave Nidoqueen", "Brave Nidoking", "Furious Crobat", "War Muk", "Banshee Misdreavus", "Trickmaster Gengar", "Brave Charizard", "Enraged Typhlosion", "Lava Magmar", "Wardog Arcanine", "War Granbull", "Singer Wigglytuff", "Moon Clefable", "Milch-Miltank", "Aviator Pidgeot", "Metal Skarmory", "Brave Noctowl", "Evil Cloyster", "Freezing Dewgong", "Heavy Piloswine", "Psy Jynx", "Ancient Dragonair"},
},
}
local function ShinyName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Shiny") then
local newName = tostring(getCreatureName(cid)):match("Shiny (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function MegaName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Mega") then
local newName = tostring(getCreatureName(cid)):match("Mega (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function GiantName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Shiny Giant") then
local newName = tostring(getCreatureName(cid)):match("Shiny Giant (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function LightName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Light") then
local newName = tostring(getCreatureName(cid)):match("Light (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function AncienttName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Ancientt") then
local newName = tostring(getCreatureName(cid)):match("Ancientt (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function GhostName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Ghost") then
local newName = tostring(getCreatureName(cid)):match("Ghost (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function WaterName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Water") then
local newName = tostring(getCreatureName(cid)):match("Water (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function FireName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Fire") then
local newName = tostring(getCreatureName(cid)):match("Fire (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function IceName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Ice") then
local newName = tostring(getCreatureName(cid)):match("Ice (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function FlyingName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Flying") then
local newName = tostring(getCreatureName(cid)):match("Flying (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function GrassName(cid)
if isCreature(cid) then
if string.find(tostring(getCreatureName(cid)), "Grass") then
local newName = tostring(getCreatureName(cid)):match("Grass (.*)")
doCreatureSetNick(cid, newName)
if isMonster(cid) then
doSetCreatureDropLoot(cid, false)
end
end
end
end
local function doSetRandomGender(cid)
if not isCreature(cid) then return true end
if isSummon(cid) then return true end
local gender = 0
local name = getCreatureName(cid)
if not newpokedex[name] then return true end
local rate = newpokedex[name].gender
if rate == 0 then
gender = 3
elseif rate == 1000 then
gender = 4
elseif rate == -1 then
gender = 0
elseif math.random(1, 1000) <= rate then
gender = 4
else
gender = 3
end
doCreatureSetSkullType(cid, gender)
end
local function doShiny(cid)
if isCreature(cid) then
if isSummon(cid) then return true end
if getPlayerStorageValue(cid, 74469) >= 1 then return true end
if getPlayerStorageValue(cid, 22546) >= 1 then return true end
if isNpcSummon(cid) then return true end
if getPlayerStorageValue(cid, 637500) >= 1 then return true end
if isInArray(shinys, getCreatureName(cid)) then
chance = 3
elseif isInArray(raros, getCreatureName(cid)) then
chance = 3
elseif isInArray(new, getCreatureName(cid)) then
chance = 3
else
return true
end
if math.random(1, 1000) <= chance*10 then
doSendMagicEffect(getThingPos(cid), 18)
local name, pos = "Shiny ".. getCreatureName(cid), getThingPos(cid)
doRemoveCreature(cid)
local shi = doCreateMonster(name, pos, false)
setPlayerStorageValue(shi, 74469, 1)
else
setPlayerStorageValue(cid, 74469, 1)
end
else
return true
end
end
function onSpawn(cid)
registerCreatureEvent(cid, "Experience")
registerCreatureEvent(cid, "GeneralConfiguration")
registerCreatureEvent(cid, "DirectionSystem")
registerCreatureEvent(cid, "CastSystem")
if isSummon(cid) then
registerCreatureEvent(cid, "SummonDeath")
return true
end
addEvent(function()
if isCreature(cid) then
if isInArray(specialSummon.pokes[2], getCreatureName(cid)) then
if math.random(1, 10000) <= specialSummon.chance*10 then
local position = getThingPos(cid)
doRemoveCreature(cid)
doCreateMonster(specialSummon.pokes[1][math.random(#specialSummon.pokes[1])], position)
end
end
end
addEvent(function()
if isCreature(cid) then
if isInArray(outlandSpawn.pokes[2], getCreatureName(cid)) then
if math.random(1, 10000) <= outlandSpawn.chance*10 then
local position = getThingPos(cid)
doRemoveCreature(cid)
doCreateMonster(outlandSpawn.pokes[1][math.random(#outlandSpawn.pokes[1])], position)
end
end
end
end, 15)
addEvent(doSetRandomGender, 5, cid)
addEvent(doShiny, 10, cid)
addEvent(ShinyName, 15, cid)
addEvent(MegaName, 15, cid)
addEvent(LightName, 15, cid)
addEvent(AncienttName, 15, cid)
addEvent(GhostName, 15, cid)
addEvent(WaterName, 15, cid)
addEvent(FireName, 15, cid)
addEvent(IceName, 15, cid)
addEvent(FlyingName, 15, cid)
addEvent(GrassName, 15, cid)
addEvent(GiantName, 15, cid)
addEvent(adjustWildPoke, 5, cid)
return true
end
[31/08/2018 02:24:19] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/spawn.lua:14: '}' expected (to close '{' at line 8) near 'local' [31/08/2018 02:24:19] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/spawn.lua) [31/08/2018 02:24:19] data/creaturescripts/scripts/spawn.lua:14: '}' expected (to close '{' at line 8) near 'local'
Link para o comentário
Compartilhar em outros sites
6 respostass a esta questão
Posts Recomendados