hello every one
some one can help me i got erro in the script
(otx2-8.60)
[Error - CreatureScript Interface]
data/creaturescripts/scripts/levels.luanAdvance
Description:
data/creaturescripts/scripts/levels.lua:39: attempt to get length of local 'data' (a nil value)
stack traceback:
data/creaturescripts/scripts/levels.lua:39: in function <data/creaturescripts/scripts/levels.lua:27>
some one can help me i got erro in the script
(otx2-8.60)
[Error - CreatureScript Interface]
data/creaturescripts/scripts/levels.luanAdvance
Description:
data/creaturescripts/scripts/levels.lua:39: attempt to get length of local 'data' (a nil value)
stack traceback:
data/creaturescripts/scripts/levels.lua:39: in function <data/creaturescripts/scripts/levels.lua:27>
Lua:
--[[ / / / / / / / / / / / / / / / / / / / / / /
Advanced OnAdvance Fancy Edition
The Best OnAdvance Creaturescript
Scripted by Cybermaster
/ / / / / / / / / / / / / / / / / / / / / / ]]--
local area, data =
{
{0, 1, 1, 1, 0},
{1, 1, 1, 1, 1},
{1, 1, 1, 1, 1},
{1, 1, 1, 1, 1},
{0, 1, 1, 1, 0}
},
{
[SKILL_FIST] = 'FISTUP!',
[SKILL_CLUB] = 'CLUBUP!',
[SKILL_SWORD] = 'SWORDUP!',
[SKILL_AXE] = 'AXEUP!',
[SKILL_DISTANCE] = 'DISTANCEUP!',
[SKILL_SHIELD] = 'SHIELDUP!',
[SKILL_FISHING] = 'FISHINGUP!',
[SKILL__MAGLEVEL] = 'MAGICUP!',
[SKILL__LEVEL] = 'LEVELUP!'
}
function onAdvance(cid, skill, oldLevel, newLevel)
doPlayerSave(cid)
local center, data = {}, data[skill] --function doSendMagicEffectInArea of Mock
center.y = math.floor(table.getn(area)/2)+1
for y = 1, table.getn(area) do
for x = 1, table.getn(area[y]) do
if area[y][x] > 0 then
center.x = math.floor(table.getn(area[y])/2)+1
doSendMagicEffect({x=getThingPos(cid).x+x-center.x,y=getThingPos(cid).y+y-center.y,z= getThingPos(cid).z},math.random(28,30),cid)
end
end
end
for i = 1, #data do
addEvent(doSendAnimatedText, i*150, getThingPos(cid), data:sub(i,i), i%2 == 0 and TEXTCOLOR_RED or TEXTCOLOR_ORANGE)
end
return true
end