Ir para conteúdo

Featured Replies

Postado

Versão 8.60 DBO, tfs 0.4

Gente estou aqui pedindo a vocês ajuda com um Script.

oque ele faz? simplesmente da uma nova vocação ao Player assim que ele pega o item.

oque eu quero? quero que o player precise clicar no item para poder receber a vocação, assim a vocação poderá ser Negociada entre os Players.

Obs : quero transformar o Script em uma Action para precisar usar Use no item para ganhar a Vocação e o LookType.

 

Script abaixo, e quem poder ajudar a editar agradecerei mt dando REP+

 

Creaturescripts.xml

<event type="think" name="VocNova" event="script" value="vocnova.lua"/>

 

Spoiler

function onThink(cid, interval)
local itemid = 5468
local outfit = {lookType = 870} -- Looktpe sem reborn
local outfit2 = {lookType = 870} -- looktype da UltraGod
local outfit3 = {lookType = 870} -- looktype reborn

if isPlayer(cid) then
if getPlayerItemCount(cid, itemid) >= 1 then
if getPlayerStorageValue(cid,99023) == 4 and doCreatureChangeOutfit(cid, outfit2) and doPlayerRemoveItem(cid, itemid, 1) and addEvent(doRemoveCreature, 1, cid) then
doPlayerSetVocation(cid, 647)
elseif getPlayerStorageValue(cid,30023) == 4 and doCreatureChangeOutfit(cid, outfit3) and doPlayerRemoveItem(cid, itemid, 1) and addEvent(doRemoveCreature, 1, cid) then
doPlayerSetVocation(cid, 647)
elseif getPlayerStorageValue(cid,60150) == 1 and doCreatureChangeOutfit(cid, outfit) and doPlayerRemoveItem(cid, itemid, 1) and addEvent(doRemoveCreature, 1, cid) then
doPlayerSetVocation(cid, 642)
end
end
return true
end
end

 

Obg a todos que tentarem ajudar :D

 

Resolvido por thelifeofpbion

Ir para solução
Postado
  • Solução

Mano, antes de tudo tenta assim.. se não der, me da um toque que eu vou achar o problema e organizar.
obs: mudei a function e identei... vê se funciona.

function onUse(cid, item, frompos, item2, topos)


local itemid = 5468
local outfit = {lookType = 870} -- Looktpe sem reborn
local outfit2 = {lookType = 870} -- looktype da UltraGod
local outfit3 = {lookType = 870} -- looktype reborn

if isPlayer(cid) then
	if getPlayerItemCount(cid, itemid) >= 1 then
		if getPlayerStorageValue(cid,99023) == 4 and doCreatureChangeOutfit(cid, outfit2) and doPlayerRemoveItem(cid, itemid, 1) and addEvent(doRemoveCreature, 1, cid) then
			doPlayerSetVocation(cid, 647)
		elseif getPlayerStorageValue(cid,30023) == 4 and doCreatureChangeOutfit(cid, outfit3) and doPlayerRemoveItem(cid, itemid, 1) and addEvent(doRemoveCreature, 1, cid) then
			doPlayerSetVocation(cid, 647)
		elseif getPlayerStorageValue(cid,60150) == 1 and doCreatureChangeOutfit(cid, outfit) and doPlayerRemoveItem(cid, itemid, 1) and addEvent(doRemoveCreature, 1, cid) then
			doPlayerSetVocation(cid, 642)
		end
	end
	
return true
end
end

 

Scriptszinhos:

 

Não abandone seu tópico, quando você tiver a dúvida resolvida sozinho tente ensinar aos outros como resolve-la (você pode não ser o único com o problema) e quando ela for resolvida por outra pessoa não se esqueça de marcar como melhor resposta e deixar o gostei.

Postado
  • Autor
12 minutos atrás, pablobion disse:

Mano, antes de tudo tenta assim.. se não der, me da um toque que eu vou achar o problema e organizar.
obs: mudei a function e identei... vê se funciona.


function onUse(cid, item, frompos, item2, topos)


local itemid = 5468
local outfit = {lookType = 870} -- Looktpe sem reborn
local outfit2 = {lookType = 870} -- looktype da UltraGod
local outfit3 = {lookType = 870} -- looktype reborn

if isPlayer(cid) then
	if getPlayerItemCount(cid, itemid) >= 1 then
		if getPlayerStorageValue(cid,99023) == 4 and doCreatureChangeOutfit(cid, outfit2) and doPlayerRemoveItem(cid, itemid, 1) and addEvent(doRemoveCreature, 1, cid) then
			doPlayerSetVocation(cid, 647)
		elseif getPlayerStorageValue(cid,30023) == 4 and doCreatureChangeOutfit(cid, outfit3) and doPlayerRemoveItem(cid, itemid, 1) and addEvent(doRemoveCreature, 1, cid) then
			doPlayerSetVocation(cid, 647)
		elseif getPlayerStorageValue(cid,60150) == 1 and doCreatureChangeOutfit(cid, outfit) and doPlayerRemoveItem(cid, itemid, 1) and addEvent(doRemoveCreature, 1, cid) then
			doPlayerSetVocation(cid, 642)
		end
	end
	
return true
end
end

 

Funcionou perfeitamente REP+ vlw msm tava precisando desse Script

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo