local config = {
experience = { min = 9999999, max = 10000000 },
minLevel = 8,
maxLevel = 160
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerLevel(cid) < config.minLevel or getPlayerLevel(cid) > config.maxLevel then
doPlayerSendCancel(cid, "Players of your level may not use this item.")
return FALSE
end
local playerExp = math.random(config.experience.min, config.experience.max)
doPlayerAddExp(cid, playerExp)
doPlayerSendTextMessage(cid, 22, "Exp scroll gave you " .. playerExp .." experience!")
doRemoveItem(item.uid, 1) -- Remove this if you want the scroll to not run out
doSendMagicEffect(getPlayerPosition(cid), 40)
return TRUE
end