Ir para conteúdo
  • 0

Spawn Aleatorio de Megas (Igual os Shinys)


fhoenix00

Pergunta

Galera Seguinte, Queria adicionar um Spawn aleatorio de pokemons megas no meu servidor...

Tentei fazer de um jeito que vi aqui no forum só que bugou tudo meu server, os ataques em area dos pokemons selvagens começaram a acertar os outros selvagens...

 

Este é meu Spawn.lua

 

Spoiler

local shinys = {
"Venusaur", "Blastoise", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Golbat", "Paras", "Parasect", "Magmar", "Typhlosion", "Xatu", "Growlithe", "Arcanine", "Tentacruel", "Farfetch'd", "Gengar", "Krabby", "Tauros", 
"Kingler", "Cubone", "Horsea", "Seadra", "Weezing", "Scyther", "Pinsir", "Crobat", "Zubat", "Tentacool", "Feraligatr", "Machamp", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}                               

local function ShinyName(cid)
if isCreature(cid) then
   if string.find(tostring(getCreatureName(cid)), "Shiny") then
      local newName = tostring(getCreatureName(cid)):match("(.*)")          
      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 == 500 then
            gender = 4
        elseif rate == -1 then
            gender = 2
        elseif math.random(1, 500) <= 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  --alterado v1.9
   
if isInArray(shinys, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --1% chance       
else
   return true
end    
    if math.random(1, 500) <= 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(doShiny, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

return true
end

 

 

Pf ajudem ai Rep+++

Link para o comentário
Compartilhar em outros sites

Posts Recomendados

  • 0
local megas = {"Venusaur", "Blastoise"} 
local shinys = {
"Venusaur", "Blastoise", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Golbat", "Paras", "Parasect", "Magmar", "Typhlosion", "Xatu", "Growlithe", "Arcanine", "Tentacruel", "Farfetch'd", "Gengar", "Krabby", "Tauros", 
"Kingler", "Cubone", "Horsea", "Seadra", "Weezing", "Scyther", "Pinsir", "Crobat", "Zubat", "Tentacool", "Feraligatr", "Machamp", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}                               

local function ShinyName(cid)
if isCreature(cid) then
   if string.find(tostring(getCreatureName(cid)), "Shiny") then
      local newName = tostring(getCreatureName(cid)):match("(.*)")          
      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 == 500 then
            gender = 4
        elseif rate == -1 then
            gender = 2
        elseif math.random(1, 500) <= 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  --alterado v1.9
   
if isInArray(shinys, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --1% chance       
else
   return true
end    
    if math.random(1, 500) <= 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

local function doMega(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  --alterado v1.9
   
if isInArray(megas, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 100.0    --1% chance        
   return true
end    
    if math.random(1, 500) <= chance*10 then  
      doSendMagicEffect(getThingPos(cid), 18)               
      local name, pos = "Mega ".. 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(doShiny, 10, cid)
    addEvent(doMega, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

return true
end

 

Não tenho certeza se vai funcionar, mas testa aí. Adiciona ali os mega que tem. Tá com 100% de chance de spawnar só pra testar, dps vc coloca a chance que vc quiser ai.

Atenção: Siga o prefixo de postagem, primeiro aviso.

 

Link para o comentário
Compartilhar em outros sites

  • 0
14 minutos atrás, bXnny disse:

local megas = {"Venusaur", "Blastoise"} 
local shinys = {
"Venusaur", "Blastoise", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Golbat", "Paras", "Parasect", "Magmar", "Typhlosion", "Xatu", "Growlithe", "Arcanine", "Tentacruel", "Farfetch'd", "Gengar", "Krabby", "Tauros", 
"Kingler", "Cubone", "Horsea", "Seadra", "Weezing", "Scyther", "Pinsir", "Crobat", "Zubat", "Tentacool", "Feraligatr", "Machamp", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}                               

local function ShinyName(cid)
if isCreature(cid) then
   if string.find(tostring(getCreatureName(cid)), "Shiny") then
      local newName = tostring(getCreatureName(cid)):match("(.*)")          
      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 == 500 then
            gender = 4
        elseif rate == -1 then
            gender = 2
        elseif math.random(1, 500) <= 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  --alterado v1.9
   
if isInArray(shinys, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --1% chance       
else
   return true
end    
    if math.random(1, 500) <= 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

local function doMega(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  --alterado v1.9
   
if isInArray(megas, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 100.0    --1% chance        
   return true
end    
    if math.random(1, 500) <= chance*10 then  
      doSendMagicEffect(getThingPos(cid), 18)               
      local name, pos = "Mega ".. 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(doShiny, 10, cid)
    addEvent(doMega, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

return true
end

 

Não tenho certeza se vai funcionar, mas testa aí. Adiciona ali os mega que tem. Tá com 100% de chance de spawnar só pra testar, dps vc coloca a chance que vc quiser ai.

Atenção: Siga o prefixo de postagem, primeiro aviso.

 

13 minutos atrás, bXnny disse:

local megas = {"Venusaur", "Blastoise"} 
local shinys = {
"Venusaur", "Blastoise", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Golbat", "Paras", "Parasect", "Magmar", "Typhlosion", "Xatu", "Growlithe", "Arcanine", "Tentacruel", "Farfetch'd", "Gengar", "Krabby", "Tauros", 
"Kingler", "Cubone", "Horsea", "Seadra", "Weezing", "Scyther", "Pinsir", "Crobat", "Zubat", "Tentacool", "Feraligatr", "Machamp", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}                               

local function ShinyName(cid)
if isCreature(cid) then
   if string.find(tostring(getCreatureName(cid)), "Shiny") then
      local newName = tostring(getCreatureName(cid)):match("(.*)")          
      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 == 500 then
            gender = 4
        elseif rate == -1 then
            gender = 2
        elseif math.random(1, 500) <= 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  --alterado v1.9
   
if isInArray(shinys, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --1% chance       
else
   return true
end    
    if math.random(1, 500) <= 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

local function doMega(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  --alterado v1.9
   
if isInArray(megas, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 100.0    --1% chance        
   return true
end    
    if math.random(1, 500) <= chance*10 then  
      doSendMagicEffect(getThingPos(cid), 18)               
      local name, pos = "Mega ".. 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(doShiny, 10, cid)
    addEvent(doMega, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

return true
end

 

Não tenho certeza se vai funcionar, mas testa aí. Adiciona ali os mega que tem. Tá com 100% de chance de spawnar só pra testar, dps vc coloca a chance que vc quiser ai.

Atenção: Siga o prefixo de postagem, primeiro aviso.

 

Amigo eu testei aqui... Infelizmente não funcionou e ainda apareceu esse erro na distro: 

 

[Error - CreatureScript Interface]
In a timer event called from:
data/creaturescripts/scripts/spawn.lua:onSpawn
Description:
data/creaturescripts/scripts/spawn.lua:82: attempt to perform arithmetic on global 'chance' (a nil value)
stack traceback:
        data/creaturescripts/scripts/spawn.lua:82: in function <data/creaturescripts/scripts/spawn.lua:70>

Link para o comentário
Compartilhar em outros sites

  • 0

Erro meu

local megas = {"Venusaur", "Blastoise"} 
local shinys = {
"Venusaur", "Blastoise", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Golbat", "Paras", "Parasect", "Magmar", "Typhlosion", "Xatu", "Growlithe", "Arcanine", "Tentacruel", "Farfetch'd", "Gengar", "Krabby", "Tauros", 
"Kingler", "Cubone", "Horsea", "Seadra", "Weezing", "Scyther", "Pinsir", "Crobat", "Zubat", "Tentacool", "Feraligatr", "Machamp", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}                               

local function ShinyName(cid)
if isCreature(cid) then
   if string.find(tostring(getCreatureName(cid)), "Shiny") then
      local newName = tostring(getCreatureName(cid)):match("(.*)")          
      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 == 500 then
            gender = 4
        elseif rate == -1 then
            gender = 2
        elseif math.random(1, 500) <= 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  --alterado v1.9
   
if isInArray(shinys, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --1% chance       
else
   return true
end    
    if math.random(1, 500) <= 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

local function doMega(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  --alterado v1.9
   
if isInArray(megas, getCreatureName(cid)) then  --alterado v1.9 \/
   local chancemega = 100.0    --1% chance        
   return true
end    
    if math.random(1, 500) <= chancemega*10 then  
      doSendMagicEffect(getThingPos(cid), 18)               
      local name, pos = "Mega ".. 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(doShiny, 10, cid)
    addEvent(doMega, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

return true
end

 

Link para o comentário
Compartilhar em outros sites

  • 0
9 minutos atrás, bXnny disse:

Erro meu


local megas = {"Venusaur", "Blastoise"} 
local shinys = {
"Venusaur", "Blastoise", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Golbat", "Paras", "Parasect", "Magmar", "Typhlosion", "Xatu", "Growlithe", "Arcanine", "Tentacruel", "Farfetch'd", "Gengar", "Krabby", "Tauros", 
"Kingler", "Cubone", "Horsea", "Seadra", "Weezing", "Scyther", "Pinsir", "Crobat", "Zubat", "Tentacool", "Feraligatr", "Machamp", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}                               

local function ShinyName(cid)
if isCreature(cid) then
   if string.find(tostring(getCreatureName(cid)), "Shiny") then
      local newName = tostring(getCreatureName(cid)):match("(.*)")          
      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 == 500 then
            gender = 4
        elseif rate == -1 then
            gender = 2
        elseif math.random(1, 500) <= 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  --alterado v1.9
   
if isInArray(shinys, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --1% chance       
else
   return true
end    
    if math.random(1, 500) <= 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

local function doMega(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  --alterado v1.9
   
if isInArray(megas, getCreatureName(cid)) then  --alterado v1.9 \/
   local chancemega = 100.0    --1% chance        
   return true
end    
    if math.random(1, 500) <= chancemega*10 then  
      doSendMagicEffect(getThingPos(cid), 18)               
      local name, pos = "Mega ".. 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(doShiny, 10, cid)
    addEvent(doMega, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

return true
end

começou a dar esse erro sem parar! 

image.thumb.png.98c771ed01f97b5275cd4311b285617e.png

 

Editado por fhoenix00
[Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/spawn.lua:114: unexpected symbol near '´' [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/spawn.lua) data/creaturescripts/scripts/spawn.lua:114: unexpected
Link para o comentário
Compartilhar em outros sites

  • 0
local megas = {"Venusaur", "Blastoise"}
local shinys = {
  "Venusaur", "Blastoise", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Golbat", "Paras", "Parasect", "Magmar", "Typhlosion", "Xatu", "Growlithe", "Arcanine", "Tentacruel", "Farfetch'd", "Gengar", "Krabby", "Tauros",
  "Kingler", "Cubone", "Horsea", "Seadra", "Weezing", "Scyther", "Pinsir", "Crobat", "Zubat", "Tentacool", "Feraligatr", "Machamp", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

  local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}

  local function ShinyName(cid)
    if isCreature(cid) then
      if string.find(tostring(getCreatureName(cid)), "Shiny") then
        local newName = tostring(getCreatureName(cid)):match("(.*)")
        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 == 500 then
      gender = 4
    elseif rate == -1 then
      gender = 2
    elseif math.random(1, 500) <= 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  --alterado v1.9

      if isInArray(shinys, getCreatureName(cid)) then  --alterado v1.9 \/
        chance = 10.0    --1% chance
      elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
        chance = 5.8   --1% chance
      else
        return true
      end
      if math.random(1, 500) <= 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

  local function doMega(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  --alterado v1.9

      if isInArray(megas, getCreatureName(cid)) then  --alterado v1.9 \/
        local chancemega = 100.0    --1% chance
        return true
      end
      if math.random(1, 500) <= chancemega*10 then
        doSendMagicEffect(getThingPos(cid), 18)
        local name, pos = "Mega ".. 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(doShiny, 10, cid)
    addEvent(doMega, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

    return true
  end

 

Cara, tá achando um caractere que nem tem no script.
Copia do jeito que tá e na hora de jogar no notepad++ da um ctr+a e seleciona essa opção: 

image.png

Link para o comentário
Compartilhar em outros sites

  • 0
16 minutos atrás, bXnny disse:

local megas = {"Venusaur", "Blastoise"}
local shinys = {
  "Venusaur", "Blastoise", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Golbat", "Paras", "Parasect", "Magmar", "Typhlosion", "Xatu", "Growlithe", "Arcanine", "Tentacruel", "Farfetch'd", "Gengar", "Krabby", "Tauros",
  "Kingler", "Cubone", "Horsea", "Seadra", "Weezing", "Scyther", "Pinsir", "Crobat", "Zubat", "Tentacool", "Feraligatr", "Machamp", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

  local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}

  local function ShinyName(cid)
    if isCreature(cid) then
      if string.find(tostring(getCreatureName(cid)), "Shiny") then
        local newName = tostring(getCreatureName(cid)):match("(.*)")
        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 == 500 then
      gender = 4
    elseif rate == -1 then
      gender = 2
    elseif math.random(1, 500) <= 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  --alterado v1.9

      if isInArray(shinys, getCreatureName(cid)) then  --alterado v1.9 \/
        chance = 10.0    --1% chance
      elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
        chance = 5.8   --1% chance
      else
        return true
      end
      if math.random(1, 500) <= 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

  local function doMega(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  --alterado v1.9

      if isInArray(megas, getCreatureName(cid)) then  --alterado v1.9 \/
        local chancemega = 100.0    --1% chance
        return true
      end
      if math.random(1, 500) <= chancemega*10 then
        doSendMagicEffect(getThingPos(cid), 18)
        local name, pos = "Mega ".. 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(doShiny, 10, cid)
    addEvent(doMega, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

    return true
  end

 

Cara, tá achando um caractere que nem tem no script.
Copia do jeito que tá e na hora de jogar no notepad++ da um ctr+a e seleciona essa opção: 

image.png

 

Nada ainda :( 

 

image.thumb.png.c80b851b3790f318e68939f3146e4eda.png

19 minutos atrás, Refe disse:

Manda seu creaturescripts.xml

<?xml version="1.0" encoding="UTF-8"?>

<creaturescripts>


    
     <event type="joinchannel" name="ShowPokedex" event="script" value="newpokedex.lua"/>
    <event type="leavechannel" name="ClosePokedex" event="script" value="newpokedex.lua"/>
    <event type="kill" name="pokemons" event="script" value="bosses.lua"/>
    <event type="login" name="aloot_reg" event="script" value="aloot.lua"/>
    <event type="kill" name="aloot_kill" event="script" value="aloot.lua"/>
    <event type="kill" name="dropStone" script="dropStone.lua"/>
    <event type="login" name="PlayerLogin" event="script" value="login.lua"/>
     <event type="login" name="AntiMc" event="script" value="antimc.lua"/>
    <event type="kill" name="ExpBonus" event="script" value="exp.lua"/>
    <event type="login" name="ExpVip" event="script" value="vipexp.lua"/>    
    <event type="logout" name="flylogoutno" registerTo="player" event="script" value="Flylogout.lua"/>
    <event type="logout" name="surflogoutno" registerTo="player" event="script" value="Surflogout.lua"/>
    <event type="logout" name="ridelogoutno" registerTo="player" event="script" value="Ridelogout.lua"/>


        <event type="death" name="ArticunoTeleport" script="tparticuno.lua"/>

       <event type="death" name="tel" event="script" value="tel.lua"/>

    <event type="receivemail" name="Mail" event="script" value="mail.lua"/>

    <event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
    
    <event type="think" name="Idle" event="script" value="idle.lua"/>


    <event type="death" name="Experience" event="script" value="pokeexp.lua"/>

    <event type="spawn" name="Spawn" event="script" value="spawn.lua"/>

    <event type="think" name="t" event="script" value="wildpoke.lua"/>

    <event type="think" name="PokemonIdle" event="script" value="poketele.lua"/>

    <event type="statschange" name="GeneralConfiguration" event="script" value="exp2.0.lua"/>
    <event type="advance" name="EffectOnAdvance" event="script" value="levelup.lua"/>


    <event type="direction" name="DirectionSystem" event="script" value="wildpoke.lua"/>
    <event type="attack" name="AttackSystem" event="script" value="wildpoke.lua"/>
    <event type="cast" name="CastSystem" event="script" value="wildpoke.lua"/>
    <event type="target" name="WildAttack" event="script" value="playerattack.lua"/>
    <event type="death" name="tp1" event="script" value="Tp-Celebi.lua"/>
    <event type="death" name="tp2" event="script" value="Tp-Heatran.lua"/>
    <event type="death" name="tp3" event="script" value="Tp-Keldeo.lua"/>
    <event type="death" name="tp4" event="script" value="Tp-Zekrom.lua"/>
    <event type="death" name="tp5" event="script" value="Tp-Giratina.lua"/>
    <event type="death" name="tp6" event="script" value="Tp-Arceus.lua"/>
    <event type="death" name="tp7" event="script" value="Tp-Cresselia.lua"/>    
    <event type="death" name="tp8" event="script" value="Tp-Terrakion.lua"/>
    <event type="death" name="tp9" event="script" value="Tp-Ho-oh.lua"/>    
    <event type="death" name="tp10" event="script" value="Tp-Cobalion.lua"/>
    <event type="death" name="tp11" event="script" value="Tp-Reshiram.lua"/>
    <event type="death" name="tp12" event="script" value="Tp-Genesect.lua"/>    


    <event type="look" name="LookSystem" event="script" value="look.lua"/>


    <event type="death" name="SummonDeath" event="script" value="goback.lua"/>
    <event type="logout" name="PlayerLogout" event="script" value="goback.lua"/>


    <event type="traderequest" name="T2" event="script" value="trade system.lua"/>

    <event type="tradeaccept" name="T1" event="script" value="trade system.lua"/>
    
    
</creaturescripts>
 

Ta ai 

Link para o comentário
Compartilhar em outros sites

  • 0
2 minutos atrás, fhoenix00 disse:

 

Nada ainda :( 

 

image.thumb.png.c80b851b3790f318e68939f3146e4eda.png

<?xml version="1.0" encoding="UTF-8"?>

<creaturescripts>


    
     <event type="joinchannel" name="ShowPokedex" event="script" value="newpokedex.lua"/>
    <event type="leavechannel" name="ClosePokedex" event="script" value="newpokedex.lua"/>
    <event type="kill" name="pokemons" event="script" value="bosses.lua"/>
    <event type="login" name="aloot_reg" event="script" value="aloot.lua"/>
    <event type="kill" name="aloot_kill" event="script" value="aloot.lua"/>
    <event type="kill" name="dropStone" script="dropStone.lua"/>
    <event type="login" name="PlayerLogin" event="script" value="login.lua"/>
     <event type="login" name="AntiMc" event="script" value="antimc.lua"/>
    <event type="kill" name="ExpBonus" event="script" value="exp.lua"/>
    <event type="login" name="ExpVip" event="script" value="vipexp.lua"/>    
    <event type="logout" name="flylogoutno" registerTo="player" event="script" value="Flylogout.lua"/>
    <event type="logout" name="surflogoutno" registerTo="player" event="script" value="Surflogout.lua"/>
    <event type="logout" name="ridelogoutno" registerTo="player" event="script" value="Ridelogout.lua"/>


        <event type="death" name="ArticunoTeleport" script="tparticuno.lua"/>

       <event type="death" name="tel" event="script" value="tel.lua"/>

    <event type="receivemail" name="Mail" event="script" value="mail.lua"/>

    <event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
    
    <event type="think" name="Idle" event="script" value="idle.lua"/>


    <event type="death" name="Experience" event="script" value="pokeexp.lua"/>

    <event type="spawn" name="Spawn" event="script" value="spawn.lua"/>

    <event type="think" name="t" event="script" value="wildpoke.lua"/>

    <event type="think" name="PokemonIdle" event="script" value="poketele.lua"/>

    <event type="statschange" name="GeneralConfiguration" event="script" value="exp2.0.lua"/>
    <event type="advance" name="EffectOnAdvance" event="script" value="levelup.lua"/>


    <event type="direction" name="DirectionSystem" event="script" value="wildpoke.lua"/>
    <event type="attack" name="AttackSystem" event="script" value="wildpoke.lua"/>
    <event type="cast" name="CastSystem" event="script" value="wildpoke.lua"/>
    <event type="target" name="WildAttack" event="script" value="playerattack.lua"/>
    <event type="death" name="tp1" event="script" value="Tp-Celebi.lua"/>
    <event type="death" name="tp2" event="script" value="Tp-Heatran.lua"/>
    <event type="death" name="tp3" event="script" value="Tp-Keldeo.lua"/>
    <event type="death" name="tp4" event="script" value="Tp-Zekrom.lua"/>
    <event type="death" name="tp5" event="script" value="Tp-Giratina.lua"/>
    <event type="death" name="tp6" event="script" value="Tp-Arceus.lua"/>
    <event type="death" name="tp7" event="script" value="Tp-Cresselia.lua"/>    
    <event type="death" name="tp8" event="script" value="Tp-Terrakion.lua"/>
    <event type="death" name="tp9" event="script" value="Tp-Ho-oh.lua"/>    
    <event type="death" name="tp10" event="script" value="Tp-Cobalion.lua"/>
    <event type="death" name="tp11" event="script" value="Tp-Reshiram.lua"/>
    <event type="death" name="tp12" event="script" value="Tp-Genesect.lua"/>    


    <event type="look" name="LookSystem" event="script" value="look.lua"/>


    <event type="death" name="SummonDeath" event="script" value="goback.lua"/>
    <event type="logout" name="PlayerLogout" event="script" value="goback.lua"/>


    <event type="traderequest" name="T2" event="script" value="trade system.lua"/>

    <event type="tradeaccept" name="T1" event="script" value="trade system.lua"/>
    
    
</creaturescripts>
 

Ta ai 

Utilize a opção image.png para postar seus códigos, por favor.

Link para o comentário
Compartilhar em outros sites

  • 0

@UP

 

Fui testar o script e no meu server ta dando isso .. 

[24/02/2019 07:52:56] >> Cargando scripts
[24/02/2019 07:52:58] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/spawn.lua:115: unexpected symbol near 'ï'
[24/02/2019 07:52:58] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/spawn.lua)
[24/02/2019 07:52:58] data/creaturescripts/scripts/spawn.lua:115: unexpected symbol near 'ï'
[24/02/2019 07:52:58] >> Cargando chat channels

Esse "symbol near 'i' " aparecia quando eu editava os .lua por bloco de notas, comecei a abrir em Notepad ++ e tinha parado de dar esse error, provavelmente era a formatação do bloco de notas. Mas mesmo no Notepad ++ ta dando esse error, mesmo formatando para ANSI como você @bXnny sugeriu .

Link para o comentário
Compartilhar em outros sites

  • 0
4 horas atrás, Kooask disse:

@UP

 

Fui testar o script e no meu server ta dando isso .. 


[24/02/2019 07:52:56] >> Cargando scripts
[24/02/2019 07:52:58] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/spawn.lua:115: unexpected symbol near 'ï'
[24/02/2019 07:52:58] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/spawn.lua)
[24/02/2019 07:52:58] data/creaturescripts/scripts/spawn.lua:115: unexpected symbol near 'ï'
[24/02/2019 07:52:58] >> Cargando chat channels

Esse "symbol near 'i' " aparecia quando eu editava os .lua por bloco de notas, comecei a abrir em Notepad ++ e tinha parado de dar esse error, provavelmente era a formatação do bloco de notas. Mas mesmo no Notepad ++ ta dando esse error, mesmo formatando para ANSI como você @bXnny sugeriu .

Me envia a linha 115

Link para o comentário
Compartilhar em outros sites

  • 0
2 horas atrás, Refe disse:

Me envia a linha 115

Foi falta de curiosidade minha não olhar a linha 115 ... Ela estava assim   

Citar

end

 O problema que deu agora foi exatamente onde o guri ali tinha falado 

 

Citar

  local function doMega(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  --alterado v1.9

      if isInArray(megas, getCreatureName(cid)) then  --alterado v1.9 \/
        local chancemega = 100.0    --1% chance                 
        return true
      end
      if math.random(1, 500) <= chancemega*10 then
        doSendMagicEffect(getThingPos(cid), 18)
        local name, pos = "Mega ".. 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

 O problema ta vindo dessa linha 79 e 82 que coloquei em Amarelo. No executável fica mostrando error nesse 'chancemega'

Editado por Kooask
Link para o comentário
Compartilhar em outros sites

  • 0

@fhoenix00 Teste

 

Spoiler

local shinys = {
"Venusaur", "Blastoise", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Golbat", "Paras", "Parasect", "Magmar", "Typhlosion", "Xatu", "Growlithe", "Arcanine", "Tentacruel", "Farfetch'd", "Gengar", "Krabby", "Tauros",
"Kingler", "Cubone", "Horsea", "Seadra", "Weezing", "Scyther", "Pinsir", "Crobat", "Zubat", "Tentacool", "Feraligatr", "Machamp", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}                               

local Mega = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}            -- pokes megas aqui                   


local function ShinyName(cid)
if isCreature(cid) then
   if string.find(tostring(getCreatureName(cid)), "Shiny") then
      local newName = tostring(getCreatureName(cid)):match("(.*)")          
      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 == 500 then
            gender = 4
        elseif rate == -1 then
            gender = 2
        elseif math.random(1, 500) <= 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  --alterado v1.9
   
if isInArray(shinys, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --1% chance       
else
   return true
end    
    if math.random(1, 500) <= 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


local function doMega(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  --alterado v1.9
   
if isInArray(Mega, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --1% chance       
else
   return true
end    
    if math.random(1, 500) <= chance*10 then  
      doSendMagicEffect(getThingPos(cid), 18)               
      local name, pos = "Megas ".. 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(doShiny, 10, cid)
    addEvent(doMega, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

return true
end

 

Link para o comentário
Compartilhar em outros sites

  • 0
Em 26/02/2019 em 11:33, Marshmello disse:

@fhoenix00 Teste

 

  Ocultar conteúdo

local shinys = {
"Venusaur", "Blastoise", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Golbat", "Paras", "Parasect", "Magmar", "Typhlosion", "Xatu", "Growlithe", "Arcanine", "Tentacruel", "Farfetch'd", "Gengar", "Krabby", "Tauros",
"Kingler", "Cubone", "Horsea", "Seadra", "Weezing", "Scyther", "Pinsir", "Crobat", "Zubat", "Tentacool", "Feraligatr", "Machamp", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode", "Megenium", "Blaziken"}

local raros = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}                               

local Mega = {"Dragonair", "Dratini", "Alakazam", "Gyarados", "Azumarill", "Dragonite", "Salamence", "Mantine", "Gardevoir", "Steelix", "Porygon", "Porygon2", "Shedinja"}            -- pokes megas aqui                   


local function ShinyName(cid)
if isCreature(cid) then
   if string.find(tostring(getCreatureName(cid)), "Shiny") then
      local newName = tostring(getCreatureName(cid)):match("(.*)")          
      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 == 500 then
            gender = 4
        elseif rate == -1 then
            gender = 2
        elseif math.random(1, 500) <= 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  --alterado v1.9
   
if isInArray(shinys, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --1% chance       
else
   return true
end    
    if math.random(1, 500) <= 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


local function doMega(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  --alterado v1.9
   
if isInArray(Mega, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 10.0    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 5.8   --1% chance       
else
   return true
end    
    if math.random(1, 500) <= chance*10 then  
      doSendMagicEffect(getThingPos(cid), 18)               
      local name, pos = "Megas ".. 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(doShiny, 10, cid)
    addEvent(doMega, 10, cid)
    addEvent(ShinyName, 15, cid)
    addEvent(adjustWildPoke, 5, cid)

return true
end

 

ok vou testar, qualquer coisa eu aviso

Acabei de testar aqui e não funcionou :/

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...