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

Trully Exp Scroll

Lava Titan

Developer
Joined
Jul 25, 2009
Messages
1,529
Solutions
1
Reaction score
85
Location
Portugal
I tryed to make a scroll that gives X amount of levels.
But i failed lmfao.
So could anyone help me fix it? xD
Ill rep++ ofc.

ExpScroll.lua:

Lua:
local cfg = {
    level = 1000,
	amount = 10000
}

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,000 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 1000 to use it.")
	return true
end
 
Add A New Function :
Lua:
function doPlayerAddLevel(cid, amount)
	local level = getPlayerLevel(cid)
	return doPlayerAddExp(cid, getExperienceForLevel(level+amount) - getExperienceForLevel(level))
end

Action/scripts/exp.lua :

Lua:
function onUse(cid, item, frompos, item2, topos)
	local pPos = getPlayerPosition(cid)
		doPlayerAddLevel(cid, 10)
		doRemoveItem(cid, item.uid, 1)
	return TRUE
end

Lua:
<action itemid="XXXX" event="script" value="exp.lua"/>

Hope it helped! =]
 
Back
Top