Ir para conteúdo

Featured Replies

Postado

Galera estou com um problema,o meu torneio está para apenas lv 150- só que quando um player 150+ fala com o npc de primeira ele consegue ir,porém se ele der tp e tentar falar com o npc dnv ele não consegue,mais muitos estão entrando no torneio 150- sendo level 150+

Script do npc 

 

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

if msgcontains(msg, 'torneio') then

if getPlayerItemCount(cid, torneio.revivePoke) >= 1 then
selfSay('Você não pode entrar no torneio portando revives.', cid)
return true
end

if getPlayerLevel(cid) >= 150 then
selfSay('Desculpa, apenas players level 150- podem ir no torneio de Johto!', cid)
return true
end

selfSay('Para entrar no torneio tem que pagar 20 hundred dollars, vai entrar?', cid)
talkState[talkUser] = 1

elseif talkState[talkUser] == 1 then

if msgcontains(msg, 'yes') or msgcontains(msg, 'sim') then
if os.date("%X") < torneiolukas.startHour1 or os.date("%X") > torneiolukas.endHour1 then
if os.date("%X") < torneiolukas.startHour2 or os.date("%X") > torneiolukas.endHour2 then
if os.date("%X") < torneiolukas.startHour3 or os.date("%X") > torneiolukas.endHour3 then
if os.date("%X") < torneiolukas.startHour4 or os.date("%X") > torneiolukas.endHour4 then
selfSay('Não está na hora do torneio...', cid)
return true
         end
      end
   end
end
if doPlayerRemoveMoney(cid, torneiolukas.price) then
doTeleportThing(cid, torneiolukas.waitPlace)
else

selfSay('Você não tem dinheiro suficiente.', cid)
end
else
selfSay('Até mais.', cid)
talkState[talkUser] = 0
end
end
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Resolvido por L3K0T

Ir para solução
  • Respostas 8
  • Visualizações 487
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • tome :D   local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(ci

Postado

tenta ai 

Citar

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
if msgcontains(msg, 'torneio') then
if getPlayerItemCount(cid, torneio.revivePoke) >= 1 then
selfSay('Você não pode entrar no torneio portando revives.', cid)
return true
end
if getPlayerLevel(cid) < 150 then
selfSay('Desculpa, apenas players level 150- podem ir no torneio de Johto!', cid)
return true
end
selfSay('Para entrar no torneio tem que pagar 20 hundred dollars, vai entrar?', cid)
talkState[talkUser] = 1
elseif talkState[talkUser] == 1 then
if msgcontains(msg, 'yes') or msgcontains(msg, 'sim') then
if os.date("%X") < torneiolukas.startHour1 or os.date("%X") > torneiolukas.endHour1 then
if os.date("%X") < torneiolukas.startHour2 or os.date("%X") > torneiolukas.endHour2 then
if os.date("%X") < torneiolukas.startHour3 or os.date("%X") > torneiolukas.endHour3 then
if os.date("%X") < torneiolukas.startHour4 or os.date("%X") > torneiolukas.endHour4 then
selfSay('Não está na hora do torneio...', cid)
return true
         end
      end
   end
end
if doPlayerRemoveMoney(cid, torneiolukas.price) then
doTeleportThing(cid, torneiolukas.waitPlace)
else
selfSay('Você não tem dinheiro suficiente.', cid)
end
else
selfSay('Até mais.', cid)
talkState[talkUser] = 0
end
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

Postado
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
if msgcontains(msg, 'torneio') then
if getPlayerItemCount(cid, torneio.revivePoke) >= 1 then
selfSay('Você não pode entrar no torneio portando revives.', cid)
return true
end
if getPlayerLevel(cid) >= 150 then
selfSay('Desculpa, apenas players level 150- podem ir no torneio de Johto!', cid)
talkState[talkUser] = 0
return true
end
selfSay('Para entrar no torneio tem que pagar 20 hundred dollars, vai entrar?', cid)
talkState[talkUser] = 1
elseif talkState[talkUser] == 1 then
if msgcontains(msg, 'yes') or msgcontains(msg, 'sim') then
if os.date("%X") < torneiolukas.startHour1 or os.date("%X") > torneiolukas.endHour1 then
if os.date("%X") < torneiolukas.startHour2 or os.date("%X") > torneiolukas.endHour2 then
if os.date("%X") < torneiolukas.startHour3 or os.date("%X") > torneiolukas.endHour3 then
if os.date("%X") < torneiolukas.startHour4 or os.date("%X") > torneiolukas.endHour4 then
selfSay('Não está na hora do torneio...', cid)
return true
         end
      end
   end
end
if doPlayerRemoveMoney(cid, torneiolukas.price) then
doTeleportThing(cid, torneiolukas.waitPlace)
else
selfSay('Você não tem dinheiro suficiente.', cid)
end
else
selfSay('Até mais.', cid)
talkState[talkUser] = 0
end
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

vodkart_logo.png

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

 

DISCORDvodkart#6090

 

Postado
  • Diretor
Em 17/08/2017 em 23:27, Lokozoido disse:

Galera estou com um problema,o meu torneio está para apenas lv 150- só que quando um player 150+ fala com o npc de primeira ele consegue ir,porém se ele der tp e tentar falar com o npc dnv ele não consegue,mais muitos estão entrando no torneio 150- sendo level 150+

Script do npc 

 

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

if msgcontains(msg, 'torneio') then

if getPlayerItemCount(cid, torneio.revivePoke) >= 1 then
selfSay('Você não pode entrar no torneio portando revives.', cid)
return true
end

if getPlayerLevel(cid) >= 150 then
selfSay('Desculpa, apenas players level 150- podem ir no torneio de Johto!', cid)
return true
end

selfSay('Para entrar no torneio tem que pagar 20 hundred dollars, vai entrar?', cid)
talkState[talkUser] = 1

elseif talkState[talkUser] == 1 then

if msgcontains(msg, 'yes') or msgcontains(msg, 'sim') then
if os.date("%X") < torneiolukas.startHour1 or os.date("%X") > torneiolukas.endHour1 then
if os.date("%X") < torneiolukas.startHour2 or os.date("%X") > torneiolukas.endHour2 then
if os.date("%X") < torneiolukas.startHour3 or os.date("%X") > torneiolukas.endHour3 then
if os.date("%X") < torneiolukas.startHour4 or os.date("%X") > torneiolukas.endHour4 then
selfSay('Não está na hora do torneio...', cid)
return true
         end
      end
   end
end
if doPlayerRemoveMoney(cid, torneiolukas.price) then
doTeleportThing(cid, torneiolukas.waitPlace)
else

selfSay('Você não tem dinheiro suficiente.', cid)
end
else
selfSay('Até mais.', cid)
talkState[talkUser] = 0
end
end
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

 

tome :D

 

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
if msgcontains(msg, 'torneio') then
if getPlayerItemCount(cid, torneio.revivePoke) >= 1 then
selfSay('Você não pode entrar no torneio portando revives.', cid)
return true
end
if getPlayerLevel(cid) <= 150 then
selfSay('Desculpa, apenas players level 150- podem ir no torneio de Johto!', cid)
return true
end
selfSay('Para entrar no torneio tem que pagar 20 hundred dollars, vai entrar?', cid)
talkState[talkUser] = 1
elseif talkState[talkUser] == 1 then
if msgcontains(msg, 'yes') or msgcontains(msg, 'sim') then
if os.date("%X") < torneiolukas.startHour1 or os.date("%X") > torneiolukas.endHour1 then
if os.date("%X") < torneiolukas.startHour2 or os.date("%X") > torneiolukas.endHour2 then
if os.date("%X") < torneiolukas.startHour3 or os.date("%X") > torneiolukas.endHour3 then
if os.date("%X") < torneiolukas.startHour4 or os.date("%X") > torneiolukas.endHour4 then
selfSay('Não está na hora do torneio...', cid)
return true
         end
      end
   end
end
if doPlayerRemoveMoney(cid, torneiolukas.price) then
doTeleportThing(cid, torneiolukas.waitPlace)
else
selfSay('Você não tem dinheiro suficiente.', cid)
end
else
selfSay('Até mais.', cid)
talkState[talkUser] = 0
end
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

o erro era só isso >> 

if getPlayerLevel(cid) >= 150 then

< = - > = +

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

Postado

Esse Sistema foi feito por min e pelo meu amigo lukas mais ele n ta 100%

 

Spoiler

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

if msgcontains(msg, 'torneio') then

if getPlayerItemCount(cid, torneio.revivePoke) >= 1 then
selfSay('Você não pode entrar no torneio portando revives.', cid)
return true
end

if getPlayerLevel(cid) >=  150 then
selfSay('Desculpa, apenas players level 150- podem ir no torneio de Johto!', cid)
return true
end

 

selfSay('Para entrar no torneio tem que pagar 20 hundred dollars, vai entrar?', cid)
talkState[talkUser] = 1

elseif talkState[talkUser] == 1 then

if msgcontains(msg, 'yes') or msgcontains(msg, 'sim') then
if os.date("%X") < torneiolukas.startHour1 or os.date("%X") > torneiolukas.endHour1 then
if os.date("%X") < torneiolukas.startHour2 or os.date("%X") > torneiolukas.endHour2 then
if os.date("%X") < torneiolukas.startHour3 or os.date("%X") > torneiolukas.endHour3 then
if os.date("%X") < torneiolukas.startHour4 or os.date("%X") > torneiolukas.endHour4 then
selfSay('Não está na hora do torneio...', cid)
return true
         end
      end
   end
end
if doPlayerRemoveMoney(cid, torneiolukas.price) then
doTeleportThing(cid, torneiolukas.waitPlace)
else

selfSay('Você não tem dinheiro suficiente.', cid)
end
else
selfSay('Até mais.', cid)
talkState[talkUser] = 0
end
end
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

Meu facebook

 

Meu Projeto

 

Meu Skype

Spoiler

brendo.dmg.yago

 

Meu Servidor Online:

Spoiler

 

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.6k

Informação Importante

Confirmação de Termo