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

How to make xp scroll

actions.xml
PHP:
  <action itemid="XXXX" event="script" value="exp.lua"/>
actions\scripts\exp.lua
Lua:
  local cfg =  {
    level = 1,
        amount = 10
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerLevel(cid, cfg.level) then
        doPlayerAddLevel(cid, cfg.amount)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You used an exp scroll and received 10 levels.")
    doSendAnimatedText(getCreaturePosition(cid), "Exp Doll", TEXTCOLOR_RED)
    doSendMagicEffect(getCreaturePosition(cid), 33)
end
    doPlayerSendCancel(cid, "You do not have enought level for this scroll, you need level 1 to use it.")
        return true
end
 
actions.xml
PHP:
  <action itemid="XXXX" event="script" value="exp.lua"/>
actions\scripts\exp.lua
Lua:
  local cfg =  {
    level = 1,
        amount = 10
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerLevel(cid, cfg.level) then
        doPlayerAddLevel(cid, cfg.amount)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You used an exp scroll and received 10 levels.")
    doSendAnimatedText(getCreaturePosition(cid), "Exp Doll", TEXTCOLOR_RED)
    doSendMagicEffect(getCreaturePosition(cid), 33)
end
    doPlayerSendCancel(cid, "You do not have enought level for this scroll, you need level 1 to use it.")
        return true
end

Ty.
 
Back
Top