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:
Here is a lua example of a exp scroll:
I made this, because couldn't find any function for this. Mby i miss it but idk.
Enjoy!
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: