• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

LevelUp Reward TFS 1.0

Code:
local t = {
  39001, {
    [20] = {2160, 2, "You have been awarded with 2 crystal coin for reaching level 20!", 1},
    [35] = {2160, 3, "You have been awarded with 3 crystal coins for reaching level 50!", 2},
    [50] = {2160, 5, "You have been awarded with 5 crystal coins for reaching level 75!", 3},
    [100] = {2160, 10, "You have been awarded with 10 crystal coins for reaching level 100!", 4},
    [150] = {2160, 15, "You have been awarded with 15 crystal coins for reaching level 100!", 5},
    [200] = {2160, 20, "You have been awarded with 20 crystal coins for reaching level 200!", 6}
    }
}

function onAdvance(cid, skill, oldlevel, newlevel)
    local player = Player(cid)
    for level, v in pairs(t[2]) do
        if skill == 8 and oldlevel < level and player:getLevel() >= level and player:getStorageValue(t[1]) < v[4] then
            player:addItem(v[1], v[2])
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, v[3])
            player:setStorageValue(t[1], v[4])
            break
        end
    end
    player:save()
    return true
end

edit: is the same one as ninja posted, sorry had the page loaded for like 10mins and didn't see the post
 
Back
Top