Como está na descrição do tópico ali, eu uso uma talkaction que vende skills.
Que é está aqui logo abaixo:
local itemretirado = 9971
function onSay(cid, words, param, channel)
local alpha={}
confere(cid)
if doPlayerRemoveItem(cid,itemretirado,1) then
if words == "!fist" and alpha[1] ~= 0 then
doPlayerAddSkillTry(cid,0,1)
elseif words == "!club" and alpha[2] ~= 1 then
doPlayerAddSkillTry(cid,1,1)
elseif words == "!sword" and alpha[3] ~= 2 then
doPlayerAddSkillTry(cid,2,1)
elseif words == "!axe" and alpha[4] ~= 3 then
doPlayerAddSkillTry(cid,3,1)
elseif words == "!distance" and alpha[5] ~= 4 then
doPlayerAddSkillTry(cid,4,1)
elseif words == "!shield" and alpha[6] ~= 5 then
doPlayerAddSkillTry(cid,5,1)
else
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'Você já atingiu o número máxido de skills para se poder comprar mais.')
end
doSendMagicEffect(getThingPos(cid),12)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'Skill comprado com sucesso.')
else
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'Você não tem o necessário para comprar esta skill.')
end
end
function confere(cid)
for x=0,5 do
if getPlayerSkillLevel(cid,x) > 349 then
alpha[x+1] = x
end
end
end
Então até funciona mas eu quero que a cada vez que o player comprar o skill pelo item seja 1 skill por 1 item.
Exemplo:
O item 9971 = Golden Igot (No meu ot é Barra de Ouro;Cópia do RadBr)
e o player ao pronunciar !axe, !club... compra 1 skill do desejado por 1 Barra de Ouro.
Se alguém souber ajeitar posta aqui por favor.
Obrigado.