I am trying to create a script that uses an item for promotion but I am getting an error; and the error doesn't even make sense since everything in the script is the same and using the same function.
Error:
Script:
Not the greatest script, but I am za beginner plix! At least I am trying right? Thanks in advance.
Solved thanks to Ninja (scroll down)
Error:
Code:
[11/12/2013 01:11:01] [Error - Action Interface]
[11/12/2013 01:11:01] data/actions/scripts/war/donor_potion.lua:onUse
[11/12/2013 01:11:01] Description:
[11/12/2013 01:11:01] (luaDoPlayerRemoveItem) Player not found
Script:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
voc = getPlayerVocation(cid)
if voc == 1 then --Is sorcerer
doPlayerSetVocation(cid,5) -- new sorcerer vocation
doCreatureSay(cid, "You feel smarter.", TALKTYPE_ORANGE_1, cid)
doPlayerRemoveItem(cid, 5080)
elseif voc == 2 then -- is druid
doPlayerSetVocation(cid,6) -- new druid vocation
doCreatureSay(cid, "You feel smarter.", TALKTYPE_ORANGE_1, cid)
doPlayerRemoveItem(cid, 5080)
elseif voc == 3 then -- is paladin
doPlayerSetVocation(cid,7) -- new paladin vocation
doCreatureSay(cid, "You feel smarter.", TALKTYPE_ORANGE_1, cid)
doPlayerRemoveItem(cid, 5080)
elseif voc == 4 then -- is knight
doPlayerSetVocation(cid,8) -- new knight vocation
doCreatureSay(cid, "You feel smarter.", TALKTYPE_ORANGE_1, cid)
doPlayerRemoveItem(cid, 5080)
else
doPlayerSendTextMessage(cid,19,"You do not need this potion.")
end
return true
end
Not the greatest script, but I am za beginner plix! At least I am trying right? Thanks in advance.
Solved thanks to Ninja (scroll down)
Last edited: