• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Help Spawn.lua

kite28

Member
Joined
May 15, 2012
Messages
69
Reaction score
5
I have a problem yesterday the server was normally turned off yesterday and suddenly there is a mistake in the image below. Gives spawn. lua

5a89cb5c46650.png


Spawn.lua

Code:
local shinysName = {
"Blastoise", "Venusaur", "Butterfree", "Beedrill", "Flygon", "Heracross", "Milotic", "Lapras", "Pidgeot", "Rattata", "Raticate", "Raichu", "Golbat", "Paras", "Parasect", "Magmar", "Typhlosion", "Xatu", "Growlithe", "Arcanine", "Tentacruel", "Gengar", "Krabby", "Tauros",
"Kingler", "Cubone", "Horsea", "Seadra","Slowking", "Weezing","Mr. mime","Sandslash", "Scyther", "Pinsir", "Crobat", "Zubat", "Tentacool", "Feraligatr", "Machamp", "Meganium", "Alakazam", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode"}

function onSpawn(cid)

    if getCreatureName(cid) == "" or getCreatureName(cid) == nil then
       setPlayerStorageValue(cid, 510, getCreatureNick(cid))
    end
   
    --if isTwoGerenetion(doCorrectString(getCreatureName(cid))) then doRemoveCreature(cid) return false end
    registerCreatureEvent(cid, "GeneralConfiguration")
    registerCreatureEvent(cid, "WildAttack")
    registerCreatureEvent(cid, "Experience")
    registerCreatureEvent(cid, "Matou")
    registerCreatureEvent(cid, "PokeWalk")
    registerCreatureEvent(cid, "StatsChange")
   
    if not ehMonstro(cid) then
        registerCreatureEvent(cid, "Target")
        registerCreatureEvent(cid, "Matou")
        registerCreatureEvent(cid, "SummonDeath")
        getPokeDistanceToTeleport(cid)
        setPokemonGhost(cid)
        if getCreatureName(cid):find("Shiny ") then
           setPlayerStorageValue(cid, storages.EhShiny, 1)
        end
    return true
    end
   
    addEvent(doShiny, 5, cid)
    addEvent(Camuflagear, 5, cid)
    addEvent(adjustWildPoke, 5, cid)
    setPokemonGhost(cid)
    doMarkedPos(cid, getThingPos(cid))
   
       if isPokePassive(cid) then
          setPokemonPassive(cid, true)
       end
   
return true
end

function PonerSigno(cid)
if isWild(cid)  then
  setCreatureName(cid, getCreatureName(cid).."[?]", "a salvaje "..getCreatureName(cid))
    end
end

function Camuflagear(cid)
if getCreatureName(cid) == "Kecleon" and isWild(cid)  then
if isSummon(cid) then return true end   
setPlayerStorageValue(cid, 89899, -1)  
    KecleonCamuWildOn(cid)
    end
   
end


function doShiny(cid)
    if isCreature(cid) then
           if isSummon(cid) then return true end
           if isNpcSummon(cid) then return true end
            local chance = 0
            if isInArray(shinysName, doCorrectString(getCreatureName(cid))) then  --alterado v1.9 \/
               chance = 12    --1.2% chance 
            end   
            local sid = cid
            if math.random(1, 1000) <= chance then 
              doSendMagicEffect(getThingPos(cid), 18)              
              local name, pos = "Shiny ".. getCreatureName(cid), getThingPos(cid)
              if not pokes[name] then return true end
              doRemoveCreature(cid)
              --print(name .. ", " .. retireShinyName(name))
              local shi = doCreateMonsterNick(sid, name, retireShinyName(name), pos, false)         
           end 
    else
                                                              
    return true
    end
end
 
I have a problem yesterday the server was normally turned off yesterday and suddenly there is a mistake in the image below. Gives spawn. lua

5a89cb5c46650.png


Spawn.lua

Code:
local shinysName = {
"Blastoise", "Venusaur", "Butterfree", "Beedrill", "Flygon", "Heracross", "Milotic", "Lapras", "Pidgeot", "Rattata", "Raticate", "Raichu", "Golbat", "Paras", "Parasect", "Magmar", "Typhlosion", "Xatu", "Growlithe", "Arcanine", "Tentacruel", "Gengar", "Krabby", "Tauros",
"Kingler", "Cubone", "Horsea", "Seadra","Slowking", "Weezing","Mr. mime","Sandslash", "Scyther", "Pinsir", "Crobat", "Zubat", "Tentacool", "Feraligatr", "Machamp", "Meganium", "Alakazam", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode"}

function onSpawn(cid)

    if getCreatureName(cid) == "" or getCreatureName(cid) == nil then
       setPlayerStorageValue(cid, 510, getCreatureNick(cid))
    end
  
    --if isTwoGerenetion(doCorrectString(getCreatureName(cid))) then doRemoveCreature(cid) return false end
    registerCreatureEvent(cid, "GeneralConfiguration")
    registerCreatureEvent(cid, "WildAttack")
    registerCreatureEvent(cid, "Experience")
    registerCreatureEvent(cid, "Matou")
    registerCreatureEvent(cid, "PokeWalk")
    registerCreatureEvent(cid, "StatsChange")
  
    if not ehMonstro(cid) then
        registerCreatureEvent(cid, "Target")
        registerCreatureEvent(cid, "Matou")
        registerCreatureEvent(cid, "SummonDeath")
        getPokeDistanceToTeleport(cid)
        setPokemonGhost(cid)
        if getCreatureName(cid):find("Shiny ") then
           setPlayerStorageValue(cid, storages.EhShiny, 1)
        end
    return true
    end
  
    addEvent(doShiny, 5, cid)
    addEvent(Camuflagear, 5, cid)
    addEvent(adjustWildPoke, 5, cid)
    setPokemonGhost(cid)
    doMarkedPos(cid, getThingPos(cid))
  
       if isPokePassive(cid) then
          setPokemonPassive(cid, true)
       end
  
return true
end

function PonerSigno(cid)
if isWild(cid)  then
  setCreatureName(cid, getCreatureName(cid).."[?]", "a salvaje "..getCreatureName(cid))
    end
end

function Camuflagear(cid)
if getCreatureName(cid) == "Kecleon" and isWild(cid)  then
if isSummon(cid) then return true end  
setPlayerStorageValue(cid, 89899, -1) 
    KecleonCamuWildOn(cid)
    end
  
end


function doShiny(cid)
    if isCreature(cid) then
           if isSummon(cid) then return true end
           if isNpcSummon(cid) then return true end
            local chance = 0
            if isInArray(shinysName, doCorrectString(getCreatureName(cid))) then  --alterado v1.9 \/
               chance = 12    --1.2% chance
            end  
            local sid = cid
            if math.random(1, 1000) <= chance then
              doSendMagicEffect(getThingPos(cid), 18)             
              local name, pos = "Shiny ".. getCreatureName(cid), getThingPos(cid)
              if not pokes[name] then return true end
              doRemoveCreature(cid)
              --print(name .. ", " .. retireShinyName(name))
              local shi = doCreateMonsterNick(sid, name, retireShinyName(name), pos, false)        
           end
    else
                                                             
    return true
    end
end
The only thing I see that may not be ok is the line
Code:
    addEvent(adjustWildPoke, 5, cid)

Where is the function adjustWildPoke?
 
The function adjustWildPoke is missing, either remove the addEvent or add the function.
 
Solution
Back
Top