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

Solved Exp Tome giving exp depending on level

steelzord

New Member
Joined
May 29, 2013
Messages
55
Reaction score
1
I tried to get player level into the function but always returns an error

function onUse(cid, item, frompos, item2, topos)
doPlayerAddExp(cid, SKILL_LEVEL * 10000)
doCreatureSay(cid, "You open the book and start to read...suddenly you feel smarter.", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
return true
end
 
Solution
try this instead doPlayerAddExp(cid, SKILL_LEVEL * 10000)
local player = Player(cid)
if not player then return false end
player:addExperience(player:getLevel() * 100000)
can you post actual script?
try this instead doPlayerAddExp(cid, SKILL_LEVEL * 10000)
local player = Player(cid)
if not player then return false end
player:addExperience(player:getLevel() * 100000)
can you post actual script?
 
Solution
no error returned however it gives a constant value of 500000 exp

try this instead doPlayerAddExp(cid, SKILL_LEVEL * 10000)
local player = Player(cid)
if not player then return false end
player:addExperience(player:getLevel() * 100000)
can you post actual script?
works perfect, actual script:

Lua:
function onUse(cid, item, frompos, item2, topos)
local player = Player(cid)
if not player then return false end
player:addExperience(player:getLevel() * 1000)
doCreatureSay(cid, "You open the book and start to read...suddenly you feel smarter.", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
return true
end
 
Back
Top