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

Max player level with StorageValue

Sorbal

Member
Joined
Jul 23, 2010
Messages
406
Reaction score
11
Location
Poland
OTlanders Hello, First I need a script that will give the possiblity to gain maximum 40 level when a player has storagevalue = 9645, and if player don't have this storagevalue he can gain max 30 level then he won't gain experience from monsters. The second request: Please edit this script:
Code:
local config = {
funnyEffect = "YES", 
minimumLevel = 13,
maximumLevel = 30, -- for infinite type math.huge
}
local addExp = {
[{config.minimumLevel, 15}] = 1500,
[{15, 17}] = 900,
[{17, 20}] = 600,
[{20, 25}] = 500,
[{25, config.maximumLevel}] = 400
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local level = getPlayerLevel(cid)
    local effect = math.random(CONST_ME_FIREWORK_YELLOW,CONST_ME_FIREWORK_BLUE) 

    if level < config.minimumLevel then
        doPlayerSendCancel(cid, "You need to be at least "..config.minimumLevel.." to use a experience egg.")
        return FALSE 
    end
    
    if level >= config.maximumLevel then
        doPlayerSendCancel(cid, "Your level is too high for using a experience egg.")
        return FALSE 
    end

    for k, v in pairs(addExp) do 
        if level >= k[1] and level < k[2] then 
            doPlayerAddExp(cid, v)
            doPlayerSendTextMessage(cid, 22, "Experience egg Gave You " .. v .." experience!")
            doRemoveItem(item.uid, 1)
            break 
        end 
    end  

        if config.funnyEffect == "YES" then
    local playerexp = addExp
        local pos = getPlayerPosition(cid)
        local positions = {
                {x=pos.x+1,y=pos.y-1,z=pos.z},
                {x=pos.x-1,y=pos.y-1,z=pos.z},
                {x=pos.x+1,y=pos.y+1,z=pos.z},
                {x=pos.x-1,y=pos.y+1,z=pos.z},
                {x=pos.x+1,y=pos.y,z=pos.z},
                {x=pos.x-1,y=pos.y,z=pos.z},
                {x=pos.x,y=pos.y+1,z=pos.z},
                {x=pos.x,y=pos.y-1,z=pos.z}
        }

        for i = 1, table.getn(positions) do
    
            doSendAnimatedText(getPlayerPosition(cid), playerexp, TEXTCOLOR_RED)
            doSendMagicEffect(positions[i],effect)
        end
    end
    return TRUE 
end
to work as the script above - player with storage can use this item from level 1 to 40, while player without storage can use it from 1 to 30 level.
 
otlanders hello, first i need a script that will give the possiblity to gain maximum 40 level when a player has storagevalue = 9645, and if player don't have this storagevalue he can gain max 30 level then he won't gain experience from monsters. The second request: Please edit this script:
SOLVED
But i still need this second script (Experience item), can someone help me please? :$
 
If i understand right here add this on action:

Code:
function onUse(cid, item, frompos, item2, topos)
local exp = 1000 <-- edit how much exprience

if isPlayer then
doPlayerAddExp(cid,exp)
doSendAnimatedText(getCreaturePosition(cid), "OH YEAH EXPRIENCE YEA!", TEXTCOLOR_RED)
doPlayerSendTextMessage(cid, 27, "You have recived "..exp.." exprience points."
doSendMagicEffect(getThingPos(cid, 32)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
end
return true
end
 
This is not what I'm looking for. I want this item had stage experience points as in the one I've pasted and the player who has StorageValue = 9645 can use the item to 40lvl, and the player without the storage can only use up to 30 LVL.
 
Back
Top