Ir para conteúdo

Featured Replies

  • Respostas 33
  • Visualizações 1.4k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Da pra tu colocar uma global storage, tipo: setGlobalStorageValue(storage_desejada, getGlobalStorageValue(storage_desejada) +1) Ai na verificação do método de comprar você coloca: if getGlobalStor

  • Você pode fazer o seguinte: elseif msgcontains(msg, 'team red') then if getPlayerItemCount(cid ,2160) >= 20 then npcHandler:say('Did you bring me the 20 crystal coins?', cid) npcHandler.topic[ci

  • n tinha pensado nisso, vlw. já editei de novo     @ -- editei de novo pq tinha faltando um "and"   usa o que eu editei lá agr que é esse:   local keywordHandler = KeywordHandler:new()  local

Postado
  • Solução

n tinha pensado nisso, vlw. já editei de novo

 

 

@ -- editei de novo pq tinha faltando um "and"

 

usa o que eu editei lá agr que é esse:

 

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 onThink() npcHandler:onThink() 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
local msg, price = string.lower(msg), 200000
local team = {["blue"]  = {storage = 34789}, ["green"] = {storage = 34790}}
if isInArray({'bilhete', 'ticket', 'tickets'}, msg) then
npcHandler:say('Você quer participar de que time por '..price..'? se sim escolha um time: {blue} ou {green}', cid)
talkState[talkUser] = 1
elseif talkState[talkUser] == 1 then
if team[msg] then
if getGlobalStorageValue(34789) < 20 and getGlobalStorageValue(34790) < 20 then
if getPlayerStorageValue(cid, 34789) <= 0 and getPlayerStorageValue(cid, 34790) <= 0 then
if doPlayerRemoveMoney(cid, price) then
setPlayerStorageValue(cid, team[msg].storage, 1)
setGlobalStorageValue(team[msg].storage,getGlobalStorageValue(team[msg].storage) < 0 and 1 or getGlobalStorageValue(team[msg].storage)+1)
npcHandler:say('aqui está seu bilhete.', cid)
else
npcHandler:say('you do not have enough money!', cid)
talkState[talkUser] = 0 
end
else
npcHandler:say('you already have ticket!', cid)
talkState[talkUser] = 0 
end
else
npcHandler:say('ticket esgotado!', cid)
talkState[talkUser] = 0 
end
end
elseif msg == "no" then 
selfSay("Then not", cid) 
talkState[talkUser] = 0 
npcHandler:releaseFocus(cid) 
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Editado por Vodkart (veja o histórico de edições)

vodkart_logo.png

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

 

DISCORDvodkart#6090

 

Postado
  • Autor

Funcionou, valeu!


Teria como quando player comprasse o ticket a outfit dele mudasse de cor? e ele só pudesse tirar a cor da outfit quando perder a storage?

Editado por arthur122222 (veja o histórico de edições)

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