Thorn
Spriting since 2013
hii, i have an item that gives you 25 lvl, but is not working correctly, once it gets used, it shoudl disappear, but stills there, making it forever, here is the error that sends
and here is the lua of the item
plz guys if anyone could help me it would solve many of my problems :C
XML:
[16/07/2013 19:22:17] [Error - Action Interface]
[16/07/2013 19:22:17] data/actions/scripts/small exp.lua:onUse
[16/07/2013 19:22:17] Description:
[16/07/2013 19:22:17] data/actions/scripts/small exp.lua:13: attempt to concatenate global 'levelCap' (a nil value)
[16/07/2013 19:22:17] stack traceback:
[16/07/2013 19:22:17] data/actions/scripts/small exp.lua:13: in function <data/actions/scripts/small exp.lua:4>
and here is the lua of the item
LUA:
local cfg = {
amount = 25 -- here how many levels you want
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if (getPlayerLevel(cid) + cfg.amount) > 717216 then
local levelCap = (717216 - getPlayerLevel(cid))
doPlayerAddLevel(cid, levelCap)
doCreatureSay(cid, "CONGRATULATIONS! You Have Advanced " .. levelCap .. " Levels!. ", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(cid), 28)
doRemoveItem(item.uid,1)
else
doPlayerAddLevel(cid, cfg.amount)
doCreatureSay(cid, "CONGRATULATIONS! You Have Advanced " .. levelCap .. " Levels!. ", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(cid), 28)
doRemoveItem(item.uid,1)
end
return TRUE
end
plz guys if anyone could help me it would solve many of my problems :C
Last edited: