Ir para conteúdo
  • 0

Corrigir erro creaturescript


maikons

Pergunta

OV5FEde.png


Alguém me ajuda a arrumar meu creaturescript?
script


local spells = {
   [1] = { --sorcerer
     level = {
       [10] = "1spell", "spell1",
       [20] = "2spell", "spell2"
     }
   },

   [2] = { --druid
     level = {
       [1] = "spell", "spell",
       [5] = "spell", "spell"
     }
   },
 
   [3] = { --paladin
     level = {
       [1] = "spell", "spell",
       [5] = "spell", "spell"
     }
   },

   [4] = { --knight
     level = {
       [1] = "1spell", "spell1",
       [5] = "2spell", "spell2"
     }
   }
}
local array_sorc = {"Sorcerer", "Master Sorcerer"}
local array_druid = {"Druid", "Elder Druid"}
local array_paladin = {"Paladin", "Royal Paladin"}
local array_knight = {"Knight", "Elite Knight"}
local text = ""
function onAdvance(cid, skill, oldLevel, newLevel)
if skill == SKILL__MAGLEVEL then
    player = Player(cid)
        if isInArray(array_sorc, player:getVocation()) then
            CONFIG = spells[1]
        elseif isInArray(array_druid, player:getVocation()) then
            CONFIG = spells[2]
        elseif isInArray(array_paladin, player:getVocation()) then
            CONFIG = spells[3]
        elseif isInArray(array_knight, player:getVocation()) then
            CONFIG = spells[4]
    end
        if not CONFIG return false end
            EVENT = CONFIG.level[player:getMagLevel()]
        if not EVENT then
    return false
    end
        for i, v in ipairs(EVENT) do
            text = text..""..i..", "
        end
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "New spells: "..text..)
        end
    return true
end


Erro;

http://i.imgur.com/OV5FEde.png

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0


local spells = {

[1] = { --sorcerer

level = {

[10] = "1spell", "spell1",

[20] = "2spell", "spell2"

}

},

 

[2] = { --druid

level = {

[1] = "spell", "spell",

[5] = "spell", "spell"

}

},

 

[3] = { --paladin

level = {

[1] = "spell", "spell",

[5] = "spell", "spell"

}

},

 

[4] = { --knight

level = {

[1] = "1spell", "spell1",

[5] = "2spell", "spell2"

}

}

}

local array_sorc = {"Sorcerer", "Master Sorcerer"}

local array_druid = {"Druid", "Elder Druid"}

local array_paladin = {"Paladin", "Royal Paladin"}

local array_knight = {"Knight", "Elite Knight"}

local text = ""

function onAdvance(cid, skill, oldLevel, newLevel)

if skill == SKILL__MAGLEVEL then

player = Player(cid)

if isInArray(array_sorc, player:getVocation()) then

CONFIG = spells[1]

elseif isInArray(array_druid, player:getVocation()) then

CONFIG = spells[2]

elseif isInArray(array_paladin, player:getVocation()) then

CONFIG = spells[3]

elseif isInArray(array_knight, player:getVocation()) then

CONFIG = spells[4]

end

if not CONFIG then return false end

EVENT = CONFIG.level[player:getMagLevel()]

if not EVENT then

return false

end

for i, v in ipairs(EVENT) do

text = text..""..i..", "

end

player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "New spells: "..text.."")

end

return true

end

 

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...