Postado Julho 20, 2015 9 anos Olá pessoas, eu preciso de um NPC que teleporte o player para essa coordenada: (PDA BY BOZ 2,3) {x = 951, y = 1463, z = 7} Outflit: 300 Nick: Monge Alguém me disponibiliza? Urgente
Postado Julho 20, 2015 9 anos Solução Em "Data/npc/scripts", monge.lua: local t = { pos = {x = 160, y = 57, z = 7}, keys = {"travel", "sail", "teleport"} } 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 msg = msg:lower(); local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if isInArray(t.keys, msg) then selfSay("Deseja ir até LOCAL?", cid) talkState[talkUser] = 1 elseif msgcontains(msg, "yes") then if talkState[talkUser] == 1 then doTeleportThing(cid, t.pos) end elseif msgcontains(msg, "no") then if talkState[talkUser] == 1 then selfSay('Ok, até mais.', cid) talkState[talkUser] = 0 end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Em "Data/npc", monge.xml: <?xml version="1.0" encoding="UTF-8"?> <npc name="Monge" script="data/npc/scripts/traveltwo.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="300" head="57" body="59" legs="40" feet="76" addons="0"/> <parameters> <parameter key="message_greet" value="Olá |PLAYERNAME|. Posso te levar até LOCAL, diga {travel}."/> </parameters> </npc> ➥ Regras | Seções OTServ | Seções BOT
Postado Julho 20, 2015 9 anos Autor :/ [20/07/2015 17:36:51] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/monge.xml). [20/07/2015 17:36:51] Line: 6, Info: Input is not proper UTF-8, indicate encoding ! [20/07/2015 17:36:51] Bytes: 0xE1 0x20 0x7C 0x50
Postado Julho 20, 2015 9 anos Em 20/07/2015 em 20:37, UnknowLoad disse: :/ [20/07/2015 17:36:51] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/monge.xml). [20/07/2015 17:36:51] Line: 6, Info: Input is not proper UTF-8, indicate encoding ! [20/07/2015 17:36:51] Bytes: 0xE1 0x20 0x7C 0x50 Tente salvar por outro editor, notepad por exemplo. Eu testei aqui e está normal! ➥ Regras | Seções OTServ | Seções BOT
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.