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

Exp Scroll Help

DestinationSer

@echo off
Joined
Mar 7, 2009
Messages
2,806
Solutions
1
Reaction score
676
Hey guys, I need a exp scroll that maximal lvl to use is 100k and gives you 50k lvls. It can only be used 1 time.
Can somebody help me?
 
Code:
local config = {
	maxlvl = 100000, -- Max level to use
	storage = 2500, -- storage value assigned
	lvlamount = 50000 -- how many levels you gain
	}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid,config.storage) < 1 then
		if not getPlayerLevel(cid) > config.maxlvl then
			doPlayerAddLevel(cid,config.lvlamount)
			doSendMagicEffect(getThingFromPos(cid),11)
			doPlayerSendTextMessage(cid,20,'You gained '..config.lvlamount' levels!')
			setPlayerStorageValue(cid,config.storage,1)
		else
			doPlayerSendtextMessage(cid,20,'You are too high level.')
			doSendMagicEffect(getThingFromPos(cid),2)
		end
	else
		doPlayerSendtextMessage(cid,20,'You may only use this once.')
		doSendMagicEffect(getThingFromPos(cid),2)
	end
	return true
end

Put it in actions.xml
 
Last edited:
Back
Top