Postado Agosto 18, 2017 7 anos 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())
Postado Agosto 18, 2017 7 anos 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 Agosto 18, 2017 7 anos 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()) [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Agosto 18, 2017 7 anos 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 < = - > = + 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 Agosto 18, 2017 7 anos 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 Spoiler https://www.facebook.com/csbjgames1 Meu Projeto Spoiler https://www.facebook.com/otpMysterious/?fref=ts Meu Skype Spoiler brendo.dmg.yago Meu Servidor Online: Spoiler Em Construção
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.