Ir para conteúdo
  • Cadastre-se

(Resolvido)[REBORN] Npc cobrando item


Ir para solução Resolvido por Vodkart,

Posts Recomendados

  • Solução

era só colocar 'and doPlayerRemoveItem(cid, ITEMID,QUANTIDADE) '

 

coloquei 2160,10

 

só trocar.

 

 

o certo era refazer o npc, mas ta ai:

 

local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)
end

function onCreatureAppear(creature)
end

function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('???')
focus = 0
talk_start = 0
end
end

function onCreatureTurn(creature)
end

function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end

function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Olá! Se voce está pronto, diga "reborn".')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Desculpe, ' .. getCreatureName(cid) .. '! Hey!.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'reborn') and getPlayerStorageValue(cid,30024) == 4 then
selfSay('Desculpe, mas voce já é rebornado.')
focus = 0
talk_start = 0
elseif msgcontains(msg, 'reborn') and (getPlayerLevel(cid) < 200 and getPlayerStorageValue(cid,30024) ~= 4) or (getPlayerLevel(cid) > 2000 and getPlayerStorageValue(cid,30024) ~= 4) then
selfSay('Apenas level 200 até 2000 podem rebornar.')
focus = 0
talk_start = 0
elseif msgcontains(msg, 'reborn') then
selfSay('Realmente quer isto?')
talk_state = 2
--_GOKU_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 2000 and getPlayerVocation(cid) == 15 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,10, 501)
talk_state = 0

--_VEGETA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 30 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,25,510)
talk_state = 0

--_PICCOLO_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 43 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,38,519)
talk_state = 0

--_C17_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 56 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,50,528)
talk_state = 0

--_GOHAN_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 70 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,561,537)
talk_state = 0

--_TRUNKS_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 82 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,74,546)
talk_state = 0

--_CELL_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 94 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,81,555)
talk_state = 0

--_FREEZA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 110 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,88,564)
talk_state = 0

--_MAJIN BOO_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 126 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,98,573)
talk_state = 0

--_BROLY_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 138 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,113,582)
talk_state = 0

--_C18_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 151 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,50,591)
talk_state = 0

--_UUB_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 163 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,128,600)
talk_state = 0

--_GOTEN_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 177 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,142,609)
talk_state = 0

--_CHIBI TRUNKS_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 191 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,151,611)
talk_state = 0

--_COOLER_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 205 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,153,620)
talk_state = 0

--_DENDE_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 217 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,169,630)
talk_state = 0

--_TSUFUL_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 229 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,180,639)
talk_state = 0

--_BARDOCK_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 242 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,194,648)
talk_state = 0

--_KURIRIN_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 255 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,205,657)
talk_state = 0

--_PAN_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 267 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,212,666)
talk_state = 0

--_KAIO_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 279 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,221,675)
talk_state = 0

--_VIDEL_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 291 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,227,684)
talk_state = 0

--_JANEMBA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 303 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,234,693)
talk_state = 0

--_TENSHINHAN_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 315 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,246,702)
talk_state = 0

--_JENK_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 327 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,257,711)
talk_state = 0

--_RADITZ_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 339 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,265,720)
talk_state = 0

--_C16_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 351 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,277,729)
talk_state = 0

--_TURLES_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 363 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,285,738)
talk_state = 0

--_BULMA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 375 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,296,747)
talk_state = 0

--_SHENRON_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 387 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,302,756)
talk_state = 0

--_VEGETTO_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 392 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,308,393)
talk_state = 0

--_TAPION_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 411 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,321,765)
talk_state = 0

--_KAME_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 424 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,335,774)
talk_state = 0

--_KING VEGETA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 436 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,347,792)
talk_state = 0

--_KAGOME_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 448 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,357,783)
talk_state = 0

--_ZAIKO_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 453 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,368,454)
talk_state = 0

--_LORD CHILLED_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 472 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,375,801)
talk_state = 0

--_C8_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 489 and doPlayerRemoveItem(cid, 2160,10) then
doReborn(cid,1,517,810)
talk_state = 0

elseif msgcontains(msg, 'yes') and talk_state == 2 then
selfSay('Desculpe, ' .. getCreatureName(cid) .. '! Voce deve estar na ultima transformação.')


elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Adeus!')
focus = 0
talk_start = 0
end
end
end

function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 45 then
if focus > 0 then
selfSay('Próximo por favor...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Adeus!')
focus = 0
end
end
end

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
20 minutos atrás, Duality disse:

@Vodkart Obrigado cara, funcionou, você comentou que teria q refazer o npc, mas se deixar assim tem perigo de aparecer algum tipo de bug ?

 

 

creio que não!

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo