• 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!

Solved Effects with Levelup (Problem)

Ryxy

SYN - Morta8.6
Joined
Jul 23, 2013
Messages
97
Reaction score
7
Location
Spain (Barcelona)
Code:
<event type="advance" name="Advance" event="script" value="levelup.lua"/>
Code:
local config = {
    [0] = { "Fist skill UP", 31},
    [1] = { "Club skill UP", 31},
    [2] = { "Sword skill UP", 31},
    [3] = { "Axe skill UP", 31},
    [4] = { "Distance skill UP", 31},
    [5] = { "Shield skill UP", 31},
    [6] = { "Fishing skill UP", 31},
    [7] = { "Magic level UP", 31},
    [8] = { "Level UP", 30}
}


function onAdvance(cid, skill, oldlevel, newlevel)

local pos = getPlayerPosition(cid)
local effectPositions = {
{x = pos.x, y = pos.y - 3, z = pos.z},
{x = pos.x, y = pos.y + 3, z = pos.z},
{x = pos.x - 3, y = pos.y, z = pos.z},
{x = pos.x + 3, y = pos.y, z = pos.z},
{x = pos.x - 2, y = pos.y - 2, z = pos.z},
{x = pos.x + 2, y = pos.y - 2, z = pos.z},
{x = pos.x + 2, y = pos.y + 2, z = pos.z},
{x = pos.x - 2, y = pos.y + 2, z = pos.z}
}

     
    for type, variable in pairs(config) do
        if skill == type then
            doCreatureSay(cid, ""..variable[1].." ["..newlevel.."]", TALKTYPE_ORANGE_1)
    for _, ePos in ipairs(effectPositions) do
        doSendDistanceShoot(pos, ePos, CONST_ANI_SMALLHOLY)
        doSendMagicEffect(ePos, CONST_ME_HOLYAREA)
            end

         
        end
    end  
return TRUE
end
Login:
Code:
registerCreatureEvent(cid,'levelup')

I think everything is correct, but when I up level it doenst works/show.. :(
Version; tfs 0.4
 
registerCreatureEvent(cid,'levelup') < You mean change levelup for Advance?

Thanks for you attention.

Yea, I fix it! thanks Limos! :)
The problem was >registerCreatureEvent(cid,'levelup') <<< " levelup " >>>
 
Last edited by a moderator:
Back
Top