Scirp

joadson15
em Scripts

joadson15

ADM Aion
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 09/02/09Posts: 8

aqui o script

é pra ele fazer um item por talkaction

o player fala !darkwand e remove 3 tipos de items e da o novo item

eu consigo fazer com 1 item, mas com 3 da erro

function onSay(cid, words, param)
if doPlayerRemoveItem(cid,6500,500) then
if doPlayerRemoveItem(cid,5944,500) then
if doPlayerRemoveItem(cid,4848,1) then
doPlayerAddItem(cid,137,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
doCreatureSay(cid, "Você fez a Dark Wand com sucesso", TALKTYPE_ORANGE_1)
else
local str = "Voce Precisa de 500 Demonic Essences,500 Soul Orbs,1 Ice Wand!."
doPlayerPopupFYI(cid, str)
doPlayerSendCancel(cid, 'Voce Precisa de 500 Demonic Essences,500 Soul Orbs,1 Ice Wand!')
return FALSE
end
end

quem arrumar mim fala qual foi o erro!

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

cara nao sei se vai da certo mas se nao me engano nessas linhas aki...

if doPlayerRemoveItem(cid,6500,500) then
if doPlayerRemoveItem(cid,5944,500) then
if doPlayerRemoveItem(cid,4848,1) then

 

era pra ta assim...

if doPlayerRemoveItem(cid,6500,500) = true then
if doPlayerRemoveItem(cid,5944,500) = true then
if doPlayerRemoveItem(cid,4848,1) = true then

 

e tb ta faltando um end ali no final do scritp... ficando assim...

 

function onSay(cid, words, param)
if doPlayerRemoveItem(cid,6500,500) = true then
if doPlayerRemoveItem(cid,5944,500) = true then
if doPlayerRemoveItem(cid,4848,1) = true then
doPlayerAddItem(cid,137,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
doCreatureSay(cid, "Você fez a Dark Wand com sucesso", TALKTYPE_ORANGE_1)
else
local str = "Voce Precisa de 500 Demonic Essences,500 Soul Orbs,1 Ice Wand!."
doPlayerPopupFYI(cid, str)
doPlayerSendCancel(cid, 'Voce Precisa de 500 Demonic Essences,500 Soul Orbs,1 Ice Wand!')
       return FALSE
end
end
end

 

posso estar errado ;D

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

joadson15

ADM Aion
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 09/02/09Posts: 8

deu erro e nao pego!

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

function onSay(cid, words, param, channel)
if doPlayerRemoveItem(cid,6500,500) and doPlayerRemoveItem(cid,5944,500) and doPlayerRemoveItem(cid,4848,1) then
doPlayerAddItem(cid,137,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
doCreatureSay(cid, "Você fez a Dark Wand com sucesso", TALKTYPE_ORANGE_1)
else
local str = "Voce Precisa de 500 Demonic Essences,500 Soul Orbs,1 Ice Wand!."
doPlayerPopupFYI(cid, str)
doPlayerSendCancel(cid, 'Voce Precisa de 500 Demonic Essences,500 Soul Orbs,1 Ice Wand!')
return FALSE
end
end

 

tenta isso... aki funciono

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

joadson15

ADM Aion
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 09/02/09Posts: 8

pego, mas se o player tiver 100 de cada item e falar !darkwand ele remove os items

e se o player tiver 500 de cada ele remove e da os items!

joaohd

Neox Boy
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 03/02/09Posts: 361Char no Tibia: Fearless Man

Tente assim:

 

function onSay(cid, words, param, channel)

local c = {
     first_item = {id = 2120, quant = 1},
     second_item = {id = 2121, quant = 1},
     third_item = {id = 2122, quant = 1},
     reward = {id = 137, quant = 1}
}


     if getPlayerItemCount(cid, c.first_item.id) >=  c.first_item.quant then
        if getPlayerItemCount(cid, c.second_item.id) >=  c.second_item.quant then
           if getPlayerItemCount(cid, c.third_item.id) >=  c.third_item.quant then
              doPlayerRemoveItem(cid, c.first_item.id, c.first_item.quant)
              doPlayerRemoveItem(cid, c.second_item.id, c.second_item.quant)
              doPlayerRemoveItem(cid, c.third_item.id, c.third_item.quant)
              doPlayerAddItem(cid, c.reward.id, c.reward.quant)               
              doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
              doCreatureSay(cid, "Você fez a Dark Wand com sucesso", TALKTYPE_ORANGE_1)
           else
               doPlayerSendCancel(cid, "Voce precisa de ".. c.third_item.quant .. " " .. getItemNameById(c.third_item.id) .. " para fazer a wand.")
           end
        else
               doPlayerSendCancel(cid, "Voce precisa de ".. c.second_item.quant .. " " .. getItemNameById(c.second_item.id) .. " para fazer a wand.")
        end
     else
               doPlayerSendCancel(cid, "Voce precisa de ".. c.first_item.quant .. " " .. getItemNameById(c.first_item.id) .. " para fazer a wand.")   
     end
return true
end

 

 

Não se esqueça de configurar.

 

 

flw

joadson15

ADM Aion
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 09/02/09Posts: 8

pronto agora pegou,

muito obrigado!!

joaohd

Neox Boy
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 03/02/09Posts: 361Char no Tibia: Fearless Man

Resolvido. Movido.

 

 

flw