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

CC per level add more than one time

zapo

Member
Joined
Nov 10, 2020
Messages
129
Solutions
3
Reaction score
11
Hi,
Script add cc but when I die and reach level again, i get a second prize
Someone know how edit?
Lua:
local config = {
    storageKey = 1000,
    {level = 8, moneyAmount = 1, storageValue = 1},
    {level = 9, moneyAmount = 5000, storageValue = 2}
}
local recc = CreatureEvent("recc")
function recc.onAdvance(player, skill, oldLevel, newLevel)
    if skill ~= SKILL_LEVEL or newLevel <= oldLevel then
        return true
    end

    for _, v in ipairs(config) do
        if newLevel >= v.level and player:getStorageValue(config.storageKey) <= v.storageValue then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, v.moneyAmount .." has landed in your inventory.")
            player:setStorageValue(v.storageValue)
            player:addItem(2160,v.moneyAmount)
            break
        end
    end

    return true
end
    recc:register()
 

I'll assume you're using TFS 1.x, next time please post your version.
 
Back
Top