Step Records 1 Postado Novembro 3, 2018 Share Postado Novembro 3, 2018 Hello, I would need a NPC script that can teleport us to a given place for the position. However, try or make sure you have a teleport Link para o comentário Compartilhar em outros sites More sharing options...
0 Marshmello 270 Postado Novembro 3, 2018 Share Postado Novembro 3, 2018 3 horas atrás, Step Records disse: Versão do Servidor: TFS - 0.3.4 Tipo de Script: npc Olá, eu precisaria de um script NPC que possa nos teletransportar para um determinado local para a posição. No entanto, tente ou certifique-se de ter um teleport Let me see if I understand, you want a script that the player is teleported to an X position? Link para o comentário Compartilhar em outros sites More sharing options...
0 Ayron5 40 Postado Novembro 3, 2018 Share Postado Novembro 3, 2018 9 horas atrás, Step Records disse: Versão do Servidor: TFS - 0.3.4 Tipo de Script: npc Hello, I would need a NPC script that can teleport us to a given place for the position. However, try or make sure you have a teleport Good friend, I do not quite understand what you're looking for. But I'll try to help you by what I understood in the title of the topic. Go into data/ npc / scripts and create an itemtravel.lua file and dump it in: Spoiler local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local pos = {x=152,y=58,z=7} -------------- position where the player will be taken local itemid = 2468 ----------------- Id of the item to be removed from the player 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 if msgcontains(msg, "offer") or msgcontains(msg, "help") then selfSay("Can I take you to this place for a "..getItemNameById(itemid).." item, speak {travel} if you want to travel", cid) talkState[cid] = 0 elseif msgcontains(msg, 'travel') then if doPlayerRemoveItem(cid, itemid, 1) then selfSay("Good trip.", cid) doTeleportThing(cid, pos) else selfSay("You do not have the required item.", cid) end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Then go back and create a NOMEDONPC.xml file and put it in: Spoiler <npc name="NOMEDONPC" script="data/npc/scripts/itemtravel.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="134" head="78" body="88" legs="0" feet="88" addons="3"/> <parameters> <parameter key="message_greet" value="Hi. For more information on my services, speak {offer}." /> <parameter key="message_farewell" value="Bye." /> <parameter key="message_walkaway" value="Bye." /> </parameters> </npc> DO NOT FORGET TO CONFIGURE PLAYER DESTINY AND ITEMID ON SCRIPT .... This script is set to remove the item from the player when it is teleported, but if you want the player to keep the item, let me know. I hope this helps. ^^ Link para o comentário Compartilhar em outros sites More sharing options...
0 Step Records 1 Postado Novembro 4, 2018 Autor Share Postado Novembro 4, 2018 23 horas atrás, Sepulturaa disse: Good friend, I do not quite understand what you're looking for. But I'll try to help you by what I understood in the title of the topic. Go into data/ npc / scripts and create an itemtravel.lua file and dump it in: Mostrar conteúdo oculto local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local pos = {x=152,y=58,z=7} -------------- position where the player will be taken local itemid = 2468 ----------------- Id of the item to be removed from the player 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 if msgcontains(msg, "offer") or msgcontains(msg, "help") then selfSay("Can I take you to this place for a "..getItemNameById(itemid).." item, speak {travel} if you want to travel", cid) talkState[cid] = 0 elseif msgcontains(msg, 'travel') then if doPlayerRemoveItem(cid, itemid, 1) then selfSay("Good trip.", cid) doTeleportThing(cid, pos) else selfSay("You do not have the required item.", cid) end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Then go back and create a NOMEDONPC.xml file and put it in: Mostrar conteúdo oculto <npc name="NOMEDONPC" script="data/npc/scripts/itemtravel.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="134" head="78" body="88" legs="0" feet="88" addons="3"/> <parameters> <parameter key="message_greet" value="Hi. For more information on my services, speak {offer}." /> <parameter key="message_farewell" value="Bye." /> <parameter key="message_walkaway" value="Bye." /> </parameters> </npc> DO NOT FORGET TO CONFIGURE PLAYER DESTINY AND ITEMID ON SCRIPT .... This script is set to remove the item from the player when it is teleported, but if you want the player to keep the item, let me know. I hope this helps. ^^ [04/11/2018 22:18:42] [Error - LuaScriptInterface::loadFile] data/npc/scripts/shiny.lua:5: unexpected symbol near 'ď' [04/11/2018 22:18:42] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/shiny.lua [04/11/2018 22:18:42] data/npc/scripts/shiny.lua:5: unexpected symbol near 'ď' Link para o comentário Compartilhar em outros sites More sharing options...
0 Ayron5 40 Postado Novembro 4, 2018 Share Postado Novembro 4, 2018 1 hora atrás, Step Records disse: [04/11/2018 22:18:42] [Error - LuaScriptInterface::loadFile] data/npc/scripts/shiny.lua:5: unexpected symbol near 'ď' [04/11/2018 22:18:42] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/shiny.lua [04/11/2018 22:18:42] data/npc/scripts/shiny.lua:5: unexpected symbol near 'ď' Use this one, I've tested it now and it's 100% travel.lua Step Records reagiu a isso 1 Link para o comentário Compartilhar em outros sites More sharing options...
0 Step Records 1 Postado Novembro 5, 2018 Autor Share Postado Novembro 5, 2018 It's Okay Thanks for help my friedns Link para o comentário Compartilhar em outros sites More sharing options...
0 Ayron5 40 Postado Novembro 5, 2018 Share Postado Novembro 5, 2018 1 hora atrás, Step Records disse: It's Okay Thanks for help my friedns you are welcome mark as best answer Good luck in your project ^^ Link para o comentário Compartilhar em outros sites More sharing options...
0 Marshmello 270 Postado Novembro 18, 2018 Share Postado Novembro 18, 2018 A questão neste tópico de suporte foi respondida e/ou o autor do tópico resolveu o problema. Este tópico está fechado e foi movido para Suporte - Resolvidos. Se você tiver outras dúvidas, crie um novo tópico. Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
Step Records 1
Hello, I would need a NPC script that can teleport us to a given place for the position. However, try or make sure you have a teleport
Link para o comentário
Compartilhar em outros sites
7 respostass a esta questão
Posts Recomendados