• 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 Erro Script

Gaber Zen

Well-Known Member
Joined
Apr 22, 2023
Messages
224
Reaction score
51
Location
Egypt
hello everyone

I got Erro There
otx-8.60

[Error - CreatureScript Interface]
data/creaturescripts/scripts/levels.lua:eek:nAdvance
Description:
data/creaturescripts/scripts/levels.lua:60: attempt to index a nil value
stack traceback:
data/creaturescripts/scripts/levels.lua:60: in function <data/creaturescripts/scripts/levels.lua:24>


Lua:
--[[ / / / / / / / / / / / / / / / / / / / / / /
               Advanced OnAdvance
        The Best OnAdvance Creaturescript
        Scripted by Cybermaster
         @The Forgotten Server
           OTLand.net
/ / / / / / / / / / / / / / / / / / / / / / ]]--


local config =
    {
        --message, distance shoot effect
        [0] = {'+Fist', 38},
        [1] = {'+Mace', 26},
        [2] = {'+Swrd', 24},
        [3] = {'+Axe', 25},
        [4] = {'+Dist', 2},
        [5] = {'+Def', 11},
        [6] = {'+Fish', 12},
        [7] = {'+ML', 35},
        [8] = {'+LvL', 39}
    }

function onAdvance(cid, skill, oldlevel, newlevel)
    if skill == SKILL__LEVEL then
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
        doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
    end

    local p = getThingPos(cid)
    local positions =
    {    --do not touch
        [1] = {
            {x=p.x+1,y=p.y,z=p.z}, 100, 900
        },
        [2] = {
            {x=p.x+1,y=p.y+1,z=p.z}, 200, 980
        },
        [3] = {
            {x=p.x,y=p.y+1,z=p.z}, 300, 1060
        },
        [4] = {
            {x=p.x-1,y=p.y+1,z=p.z}, 400, 1140
        },
        [5] = {
            {x=p.x-1,y=p.y,z=p.z}, 500, 1220
        },
        [6] = {
            {x=p.x-1,y=p.y-1,z=p.z}, 600, 1300
        },
        [7] = {
            {x=p.x,y=p.y-1,z=p.z}, 700, 1380
        },
        [8] = {
            {x=p.x+1,y=p.y-1,z=p.z}, 800, 1460
        }
    }
      
    for i = 1, 8 do
        addEvent(doSendDistanceShoot, positions[i][2], positions[i][1], p, config[skill][2])
        addEvent(doSendDistanceShoot, positions[i][3], positions[i][1], p, config[skill][2])
        addEvent(doSendDistanceShoot, positions[i][4], positions[i][1], p, config[skill][2])
        addEvent(doSendDistanceShoot, positions[i][5], positions[i][1], p, config[skill][2])
    end
    
    doSendAnimatedText(p, config[skill][1].." ["..newlevel.."]", TALKTYPE_ORANGE_2)
    doPlayerSave(cid, true)   
    return true
end
 
Back
Top