ZeeBeast
Preferable Beta Tester
Okay. so I want to start off by saying with this script, I plan to make multiple quests for items that can promote you to a certain vocation. Every base vocation can pick one of two classes. Here is the script so far:
Now, the code works almost perfectly except....... When I log out, I'm back to the starting vocation. Why is this?
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(fromPosition.x ~= CONTAINER_POSITION) then
if (getPlayerVocation(cid) == 1) then
doSendMagicEffect(fromPosition, (CONST_ME_FIREWORK_YELLOW))
doRemoveItem(cid, item.uid, 1)
doPlayerSetVocation(cid, 5)
doCreatureSay(cid, 'Congratulataions! You are now a professional Warlock!', TALKTYPE_ORANGE_1)
else
doSendMagicEffect(fromPosition, (CONST_ME_POOF))
doCreatureSay(cid, 'You must be a Sorcerer to use this item.', TALKTYPE_ORANGE_1)
end
else
if (getPlayerVocation(cid) == 1) then
doSendMagicEffect(fromPosition, (CONST_ME_FIREWORK_BLUE))
doRemoveItem(cid, item.uid, 1)
doPlayerSetVocation(cid, 5)
doCreatureSay(cid, 'Congratulataions! You are now a professional Warlock!', TALKTYPE_ORANGE_1)
else
doSendMagicEffect(fromPosition, (CONST_ME_POOF))
doCreatureSay(cid, 'You must be a Sorcerer to use this item.', TALKTYPE_ORANGE_1)
end
end
return
end
Now, the code works almost perfectly except....... When I log out, I'm back to the starting vocation. Why is this?