Sinceramente, tem um monte de coisa desnecessária neste script, use esse:
function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid,1992) == 1 then doCreatureSay(cid, "Você ja recebeu a nova vocação", TALKTYPE_ORANGE_1) return true end if getPlayerLevel(cid) >= 20 then -- 20, level minimo para usar. if getPlayerVocation(cid) == 2 then -- 2, vocação que tem que ser. doPlayerSetVocation(cid, 6) -- 6, vocação que irá transformar. doSendMagicEffect(fromPosition, 29) doRemoveItem(item.uid,1) setPlayerStorageValue(cid,1992,1) else doCreatureSay(cid, "Você não pode receber esta vocação.", TALKTYPE_ORANGE_1) end else doCreatureSay(cid, "Você deve ter level 20 ou mais para usar o Item!",TALKTYPE_ORANGE_1) end return true end
Reformulei para ficar melhor a execução do mesmo.
Créditos pro @Newtonnotwen.






info
Grupo: Conde
Registrado: 04/08/12
Posts: 762
Reputação: +80
achei o erro, tira isso:
if getPlayerStorageValue(cid, 1992) ~= -1 then
doPlayerSetVocation(cid, getPlayerStorageValue(cid, 1992))
end
Cola esse script abaixo:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid,1992) == 1 then
doCreatureSay(cid, "Você ja recebeu a nova vocaçao", TALKTYPE_ORANGE_1)
else if getPlayerLevel(cid) >= 20 then
doCreatureSay(cid, "você recebeu uma nova vocaçao!", TALKTYPE_ORANGE_1)
if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 2 then
doPlayerSetVocation(cid, 6)
end
if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 2 then
doPlayerSetVocation(cid, 6)
end
if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 2 then
doPlayerSetVocation(cid, 6)
end
if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 2 then
doPlayerSetVocation(cid, 6)
end
doSendMagicEffect(fromPosition, 2)
doRemoveItem(item.uid)
setPlayerStorageValue(cid,1992,1)
return TRUE
else
doCreatureSay(cid, "Você deve ter level 20 ou mais para usar o Item!",TALKTYPE_ORANGE_1)
end
end
end
Esse script só transforma vocação de id 2 para id 6 (como você me pediu), lembrando que pode ser editado (seguindo o tutorial que apresentei nesse mesmo tópico).
Obs: Se algum player usar sem ter a vocação 2 ele não ganha, mas o item some.
Pronto, agora me diz se funcionou.
@Jhon92
Desculpa, não vi direito e achei era outro script.
Malz.
Editado Agosto 10 por Newtonnotwen