Postado Dezembro 13, 2017 7 anos Venho através deste topico pedir um npc de viajem mais um pouco diferente você pode viajar com ele somente uma vez, caso tente viajar mais de uma vez aparece uma mensagem dizendo algo como você já viajou comigo!, e queria também que para viajar ser preciso um x level desde já agradeço <3.
Postado Dezembro 13, 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 local config = { level = 300, -- Level que precisara para viajar sto = 44444, -- Storage não mecher pos = {x = 2592, y = 1152, z = 7}, -- Position para onde o player sera teleportado } if(msgcontains(msg, 'yes' )) then if getPlayerStorageValue(cid, config.sto) == -1 then if getPlayerLevel(cid) >= config.level then selfSay('Parábens', cid) setPlayerStorageValue(cid, config.sto, 1) doTeleportThing(cid, config.pos) else selfSay('Você não tem o level necessário.', cid) end else selfSay('você já viajou comigo!' , cid) return true end end end xml <?xml version="1.0" encoding="UTF-8"?> <npc name="Luis" script="NomeDoArquivo.lua" walkinterval="0" floorchange="0"> <health now="150" max="150"/> <look type="826" head="20" body="100" legs="50" feet="99" corpse="2212"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|. Deseja viajar comigo?."/> </parameters> </npc> @bismarkzika Editado Dezembro 13, 2017 7 anos por gabrielzika (veja o histórico de edições) MEU SERVER: http://otpokemonxy.net/ Nosso → Grupo Oficial OtPokemon XY 24 Horas Nosso → Site Oficial OtPokemon XY 24 Horas Nossa → Pagina Oficial OtPokemon XY 24 Horas
Postado Dezembro 13, 2017 7 anos Autor 1 hora atrás, gabrielzika disse: 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 config = { level = 300, -- Level que precisara para viajar sto = 44444, -- Storage não mecher pos = {x = 2592, y = 1152, z = 7}, -- Position para onde o player sera teleportado } if(msgcontains(msg, 'yes' )) then if getPlayerStorageValue(cid, config.sto) == -1 then if getPlayerLevel(cid) >= config.level then selfSay('Parábens', cid) setPlayerStorageValue(cid, config.sto, 1) doTeleportThing(cid, config.pos) else selfSay('Você não tem o level necessário.', cid) end else selfSay('você já viajou comigo!' , cid) return true end end end xml <?xml version="1.0" encoding="UTF-8"?> <npc name="Luis" script="NomeDoArquivo.lua" walkinterval="0" floorchange="0"> <health now="150" max="150"/> <look type="826" head="20" body="100" legs="50" feet="99" corpse="2212"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|. Deseja viajar comigo?."/> </parameters> </npc> @bismarkzika Obrigado vou testar aqui. 2 horas atrás, gabrielzika disse: 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 config = { level = 300, -- Level que precisara para viajar sto = 44444, -- Storage não mecher pos = {x = 2592, y = 1152, z = 7}, -- Position para onde o player sera teleportado } if(msgcontains(msg, 'yes' )) then if getPlayerStorageValue(cid, config.sto) == -1 then if getPlayerLevel(cid) >= config.level then selfSay('Parábens', cid) setPlayerStorageValue(cid, config.sto, 1) doTeleportThing(cid, config.pos) else selfSay('Você não tem o level necessário.', cid) end else selfSay('você já viajou comigo!' , cid) return true end end end xml <?xml version="1.0" encoding="UTF-8"?> <npc name="Luis" script="NomeDoArquivo.lua" walkinterval="0" floorchange="0"> <health now="150" max="150"/> <look type="826" head="20" body="100" legs="50" feet="99" corpse="2212"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|. Deseja viajar comigo?."/> </parameters> </npc> @bismarkzika @gabrielzika Eu falo hi mais o npc não responde.
Postado Dezembro 14, 2017 7 anos Solução @bismarkzika 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 config = { level = 300, -- Level que precisara para viajar sto = 44444, -- Storage não mecher pos = {x = 1037, y = 1036, z = 7}, -- Position para onde o player sera teleportado } if msgcontains(msg, 'yes') then if getPlayerStorageValue(cid, config.sto) < 1 then if getPlayerLevel(cid) >= config.level then selfSay('Parábens', cid) setPlayerStorageValue(cid, config.sto, 1) doTeleportThing(cid, config.pos) else selfSay('Você não tem o level necessário.', cid) end else selfSay('você já viajou comigo!' , cid) return true end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) MEU SERVER: http://otpokemonxy.net/ Nosso → Grupo Oficial OtPokemon XY 24 Horas Nosso → Site Oficial OtPokemon XY 24 Horas Nossa → Pagina Oficial OtPokemon XY 24 Horas
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.