Postado Novembro 10, 2017 7 anos iaew galera do TK blz? já procurei em tudo que é lugar e não acho um que funcione 100%. é apenas um script onde o player com lvl 1300- consegue passar pela porta, caso ele seja 1301+ não conseguisse. caso tenha problemas com a porta, também poderia ser um TP ou até Npc mesmo. com max level 1300. versão 8.60 tfs 0.4 agradecidos
Postado Novembro 10, 2017 7 anos Solução Porta Em actions/scripts, crie um arquivo.lua: Spoiler local maxLevel = 1300 local newPos = {x = 1, y = 1, z = 1} function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerLevel(cid) > maxLevel then doPlayerSendCancel(cid, "Only players level "..maxLevel.." or lower can enter.") return true end doTeleportThing(cid, newPos) doSendMagicEffect(newPos, CONST_ME_TELEPORT) return true end No actions.xml: <action actionid="ACTION_ID_DA_PORTA" script="NOMEDOARQUIVO.lua" /> Tp Em movements/scripts, crie um arquivo.lua: Spoiler local maxLevel = 1300 local newPos = {x = 1, y = 1, z = 1} function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if getPlayerLevel(cid) > maxLevel then doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "Only players level "..maxLevel.." or lower can enter.") return true end doTeleportThing(cid, newPos) doSendMagicEffect(newPos, CONST_ME_TELEPORT) return true end No movements.xml: <movevent type="StepIn" actionid="ACTION_ID_DO_TELEPORT" event="script" value="NOMEDOARQUIVO.lua"/> Npc Spoiler local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local npcTopic = {} 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 local maxLevel = 1300 local newPos = {x = 1, y = 1, z = 1} function creatureSayCallback(cid, type, msg) local msg = string.lower(msg) if not npcHandler:isFocused(cid) then if isInArray({"hi", "hello"}, msg) then npcHandler:addFocus(cid) if getPlayerLevel(cid) <= maxLevel then npcHandler:say("Hi, ".. getPlayerName(cid).."! I can {travel} you.", cid) npcTopic[cid] = 1 else npcHandler:say("Only players level "..maxLevel.." or lower are allowed to enjoy my services." , cid) npcTopic[cid] = 0 npcHandler:releaseFocus(cid) end else return false end elseif msgcontains(msg, "travel") and npcTopic[cid] == 1 then doTeleportThing(cid, newPos) doSendMagicEffect(newPos, CONST_ME_TELEPORT) npcHandler:say("Bye, brave adventurer!", cid) npcTopic[cid] = 0 elseif msgcontains(msg, "bye") then npcHandler:say("Bye.", cid) npcHandler:releaseFocus(cid) else npcHandler:say("What?", cid) npcTopic[cid] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) Um arquivo xml como base: <?xml version="1.0" encoding="UTF-8"?> <npc name="Dwarfer" script="NOMEDOARQUIVO.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="66"/> </npc> Contato: Email: [email protected] Discord: Dwarfer#2715
Postado Novembro 10, 2017 7 anos Autor @Dwarfer sem comparações, eu precisava apenas de 1 dos 3 scripts, e você fez logo os 3. já testei e funcionou perfeitamente. já dei meu REP+ e classifiquei como melhor Resposta!
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.