• 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 Reward multiple with exp stage!

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,782
Solutions
31
Reaction score
2,286
Location
Sweden?
Hello,

i made this function to my real map server, to add exp x players exprience stage!

Example if exp stage is:
1-20 = 50x then if you open a chest and you are under level 20, you will get the amount x 50

Go into lib/050-functions.lua and add the code below:
Lua:
function AddStageExp(cid, amount)
	if(amount == nil) then 
		return false
	end
 
	if(not isPlayer(cid)) then 
		return false
	end
 
	return (doPlayerAddExp(cid,amount*getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier)))
end

Here is a lua example of a exp scroll:
Lua:
local config = {
	scroll_exp = 100,
	scroll_level = 50
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if (getPlayerLevel(cid) >= config.scroll_level) then
		AddStageExp(cid,config.scroll_exp)
		doRemoveItem(item.uid, 1)
	else
		doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"Sorry, but it requires level "..config.scroll_level.." to use this scroll.")
	end
	return true
end

I made this, because couldn't find any function for this. Mby i miss it but idk.

Enjoy!
 
Last edited:
Back
Top