Ir para conteúdo
  • Cadastre-se

NPC QUE VENDE PREMMY APENAS


Posts Recomendados

Alguém teria pode gentileza um script de npc que vende Premium Account apenas? axei scripts que vende premmy e promotion, e não sei mexer.. alguém poderia ajudar?

 

 

Ok, tanks.

Link para o post
Compartilhar em outros sites
  • Respostas 5
  • Created
  • Última resposta

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

you're welcome

local focus = 0
local talk_start = 0
local target = 0
local days = 0


function onThingMove(creature, thing, oldpos, oldstackpos)


end




function onCreatureAppear(creature)


end




function onCreatureDisappear(cid, pos)
   if focus == cid then
          selfSay('Good bye then.')
          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('Hello ' .. creatureGetName(cid) .. '! I sell premiums.')
  focus = cid
  talk_start = os.clock()


elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
   selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')


   elseif focus == cid then
talk_start = os.clock()




if msgcontains(msg, 'premium') or msgcontains(msg, 'premmy') then
selfSay('Do you want to buy 7 days of premium for 7k?')
talk_state = 1


elseif talk_state == 1 then
if msgcontains(msg, 'yes') then
if pay(cid,7000) then
selfSay('/premium '.. creatureGetName(cid) ..', 7')
selfSay('You have 7 days of premium more!')
else
selfSay('Sorry, you do not have enough money.')
end
end
talk_state = 0


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




function onCreatureChangeOutfit(creature)


end




function onThink()
doNpcSetCreatureFocus(focus)
   if (os.clock() - talk_start) > 30 then
   if focus > 0 then
   selfSay('Next Please...')
   end
   focus = 0
   end
  if focus ~= 0 then
  if getDistanceToCreature(focus) > 5 then
  selfSay('Good bye then.')
  focus = 0
  end
  end
end

Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá!

"Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

Link para o post
Compartilhar em outros sites

White Wolf, como sempre o cara rs.. mas me fala uma coisa, este npc está no modo antigo? tipo ele não fala pelo canal de NPCS? como faço pra mudar?

 

e também só da pra falar 1 player de cada vez ;x

 

Agradeço amigo, abç!

Link para o post
Compartilhar em outros sites

vê se agora tá certinho do jeito que vc queria 


local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}




function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end






function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
  


if (msgcontains(msg, 'hi') and getDistanceToCreature(cid) < 4 then
  selfSay('Hello ' .. creatureGetName(cid) .. '! I sell premiums.')
  


if msgcontains(msg, 'premium') or msgcontains(msg, 'premmy') then
selfSay('Do you want to buy 7 days of premium for 7k?')
talkState[talkUser] = 1


elseif talkState[talkUser] = 1 then
if msgcontains(msg, 'yes') then
if pay(cid,7000) then
selfSay('/premium '.. creatureGetName(cid) ..', 7')
selfSay('You have 7 days of premium more!')
else
selfSay('Sorry, you do not have enough money.')
end
end
talkState[talkUser] = 0


   elseif msgcontains(msg, 'bye')  and getDistanceToCreature(cid) < 4 then
   selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
   talkState[talkUser] = 0
   end   
end
talkState[talkUser] = 0
elseif(msgcontains(msg, 'no')) and isInArray({1}, talkState[talkUser]) == TRUE then
talkState[talkUser] = 0
selfSay('Ok.', cid)
end
  
return true
end
  
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

eu to sem server pra testar então desculpa qualquer bug, npc não é minha área kk

Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá!

"Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

Link para o post
Compartilhar em outros sites

deu algum erro, como se tivesse faltando algo rsrs.. alguma coisa ta faltando..

 

 

 

Hidden Content

    Give reaction to this post to see the hidden content.

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.

  • Estatísticas dos Fóruns

    96846
    Tópicos
    519606
    Posts



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo