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

Level scroll! with max level

kimeri

New Member
Joined
Nov 27, 2007
Messages
186
Reaction score
0
Location
Sweden
Hey enyone have a script for a level scroll you gain like 20 levels and max level is 500
++++rep for this!
Peace!
 
I'm not sure if this works, since I can't test it.
But heres the script I made:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

	local currentLevel = getPlayerLevel(cid)  
        local expGain = currentLevel * 2 * 100

    if getPlayerLevel(cid) >= 500 then
        doCreatureSay(cid, 'You level is too high.', TALKTYPE_ORANGE_1)
    return false
    end
   
    doRemoveItem(item.uid)
    doPlayerAddExp(cid, currentLevel * 2 * 100) 
    doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
    doCreatureSay(cid, 'You gained '.. expGain ..' exp!', TALKTYPE_ORANGE_1)
return true
end
Save it to "other/levelscroll.lua"

Then add this to Actions.xml:
Code:
<action itemid="7722" script="other/levelscroll.lua"/>

You can change the item, by editing this part:
Code:
<action itemid="[b]7722[/b]" script="other/levelscroll.lua"/>

Test it, and tell me if theres any problem ;D
 
Last edited:
No way..

doPlayerAddExp(cid, currentLevel * 2 * 100)
Adds experience equal to the level * 200 but he wants 20 level and not 200 and also it would be + not * and anyway you need to use that getExperienceForLevel function or so to get the right number of exp..
 
No way..

doPlayerAddExp(cid, currentLevel * 2 * 100)
Adds experience equal to the level * 200 but he wants 20 level and not 200 and also it would be + not * and anyway you need to use that getExperienceForLevel function or so to get the right number of exp..

I know, but I just needed to know if the script itself works.
 
Code:
function onUse(cid,item,fromPosition,itemEx,toPosition)
local v = getThingPos(cid)
	if not(getPlayerLevel(cid) > 500)then
		if(getPlayerLevel(cid) > 480)then
			doRemoveItem(item.uid)
			doPlayerAddLevel(cid,getPlayerLevel(cid)-500)
			doSendMagicEffect(v,11)
			doPlayerSendTextMessage(cid,27,'You\'ve gained '..(getPlayerLevel(cid)-500)..' levels.')
		else
			doRemoveItem(item.uid)
			doPlayerAddLevel(cid,20)
			doSendMagicEffect(v,12)
			doPlayerSendTextMessage(cid,27,'You\'ve gained 20 levels.')
		end
	else
		doPlayerSendTextMessage(cid,27,'You can\'t use this scroll above level 500!')
		doSendMagicEffect(v,2)
	end
	return true
end
 
Back
Top