Postado Abril 3, 2015 10 anos preciso de um NPC que diga hi e automaticamente seja enviado a tal posição, alguém pode me ajudar? AQUI ESTÁ O MEU SCRIPTS local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local pos = {x=99,y=188,z=7} 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 selfSay("SUMA!.", cid) talkState[cid] = 0 doTeleportThing(cid, pos) return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Postado Abril 3, 2015 10 anos local position = {x=652, y=1022, z=7}; -- Pra onde vai ser teleportado 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:lower(), 'teleport') then selfSay('you are sure?', cid) talkState[talkUser] = 1 elseif msgcontains(msg:lower(), 'yes') and talkState[talkUser] == 1 then selfSay('Suma!!', cid) doTeleportThing(cid, position) talkState[talkUser] = 0 elseif msgcontains(msg:lower(), 'no') and talkState[talkUser] == 1 then selfSay('Bye!!', cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) hi/teleport/yes
Postado Abril 4, 2015 10 anos Autor local position = {x=652, y=1022, z=7}; -- Pra onde vai ser teleportado 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:lower(), 'teleport') then selfSay('you are sure?', cid) talkState[talkUser] = 1 elseif msgcontains(msg:lower(), 'yes') and talkState[talkUser] == 1 then selfSay('Suma!!', cid) doTeleportThing(cid, position) talkState[talkUser] = 0 elseif msgcontains(msg:lower(), 'no') and talkState[talkUser] == 1 then selfSay('Bye!!', cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) hi/teleport/yes fui seco... deu certo não brother :/ tenho que falar hi/yes do mesmo jeito... quero um script que quando falar "hi" já se teletransportar automaticamente
Postado Abril 4, 2015 10 anos preciso de um NPC que diga hi e automaticamente seja enviado a tal posição quero um script que quando falar "hi" já se teletransportar automaticamente Tenta assim: local position = {x=652, y=1022, z=7}; -- Pra onde vai ser teleportado 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) doTeleportThing(cid, position) return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Te ajudei?? REP + e ficamos quites... http://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'> Atenciosamente, Daniel. Abraços! Meus tutoriais: Programação: Resolvendo QUALQUER erro na data base. Scripts (system's, creaturescripts, mod's, NPC's, etc): (Sistema) GOD Ambient Light Full. Adicionando novas mounts ao servidor [NPC] Papai Noel que dá presente todo ano. Web-site: Resolvendo problema de caracteres especiais em PHP Formatando textos em PHP! Mudando a cor, tamanho, fonte, etc. Criando e configurando tabelas para paginas PHP
Postado Abril 4, 2015 10 anos Autor Tenta assim: local position = {x=652, y=1022, z=7}; -- Pra onde vai ser teleportado 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) doTeleportThing(cid, position) return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) agora nem com o YES deu certo...
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.