gmstrikker
Well-Known Member
- Joined
- Jul 30, 2014
- Messages
- 458
- Solutions
- 1
- Reaction score
- 50
It's don't work and now give me this msg error, any can fix this script for me?
Code:
local spells = {
[1] = { --sorcerer
level = {
[1] = "utevo lux", "exura", "adori",
[40] = "exevo gran mas vis"
}
},
[2] = { --druid
level = {
[1] = "utevo lux", "exura", "adori",
[28] = "exevo gran mas pox"
}
},
[3] = { --paladin
level = {
[1] = "utevo lux", "exura", "exevo con",
[14] = "exevo con vis"
}
},
[4] = { --knight
level = {
[1] = "utevo lux", "exura",
[5] = "exori"
}
}
}
local array_sorc = {1,4,8}
local array_druid = {2,5,9}
local array_paladin = {3,6,10}
local array_knight = {4,7,11}
local text = ""
function onAdvance(player, skill, oldLevel, newLevel)
if skill ~= SKILL_LEVEL then
player = Player(cid)
if player:getVocation():getBase():getId() == array_sorc then
CONFIG = spells[1]
elseif player:getVocation():getBase():getId() == array_druid then
CONFIG = spells[2]
elseif player:getVocation():getBase():getId() == array_paladin then
CONFIG = spells[3]
elseif player:getVocation():getBase():getId() == array_knight then
CONFIG = spells[4]
end
if not CONFIG then
return false
end
EVENT = CONFIG.level[player:getLevel()]
if not EVENT then
return false
end
for i, v in ipairs(EVENT) do
text = text..""..i..", "
end
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "New spells: "..text.."")
end
return true
end