Postado Fevereiro 21, 2018 7 anos Eu Procurei por ae e não achei, eu queria um npc que falasse com player só Exemplo: Player: hi Npc: Ola Player voce gostaria de saber da "historia" Npc: Olá player "a msg que eu por pra qnd falar historia" - Essa parte historia, quando ele fala manda outra msg falando a historia que eu por no script.
Postado Fevereiro 22, 2018 7 anos na pasta npc criar Historiador.xml ou entao outro nome de sua preferencia se for trocar tem que trocar no xml tbm, a msg inicial pode ser trocada aqui! <?xml version="1.0" encoding="UTF-8"?> <npc name="Historiador" script="historiador.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="128" head="17" body="54" legs="114" feet="0" addons="2"/> <parameters> <parameter key="message_greet" value="Ola Player voce gostaria de saber da {historia}?"/> </parameters> </npc> em scripts criar historiador.lua 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) -- By Vabrindox if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'historia') then -- By Vabrindox selfSay('Essa e a segunda msg que eu estou falando, para saber mais fale {Vabrindox}!', cid) talkState[talkUser] = 1 elseif talkState[talkUser] == 1 then if msgcontains(msg, 'vabrindox') then selfSay('O vabrindox faz scripts noobs para os noobs, haha!', cid) talkState[talkUser] = 0 end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
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.