Postado Maio 10, 2014 11 anos local function getPlayerInArea(fromPos, toPos) local online = getPlayersOnline() local players = {} for i=1, #online do if isInArea(getPlayerPosition(online[i]), fromPos, toPos) then players[#players+1] = online[i] end end return players end function onStepIn(cid, position, fromPostion, toPosition) local fromPos = {x =1000, y =1000, z =7} -- Posição da área (de) local toPos = {x =2000, y =2000, z =7} -- Posição da área (até) local actionID = 2520 -- Action ID que você colocará no Teleporte local players = getPlayerInArea(fromPos, toPos) if isPlayer(cid) then if item.actionid == actionID then if #players > 1 then doTeleportThing(cid, fromPosition) end end end return true end Bem, tenta esse... se houver algum erro no distro, printa, e me mande. Bote da forma que eu coloquei. 愛"A alma permanece em suas criações" 平(Não dou suporte por mensagem privada.)
Postado Maio 10, 2014 11 anos Autor local function getPlayerInArea(fromPos, toPos) local online = getPlayersOnline() local players = {} for i=1, #online do if isInArea(getPlayerPosition(online[i]), fromPos, toPos) then players[#players+1] = online[i] end end return players end function onStepIn(cid, position, fromPostion, toPosition) local fromPos = {x =1000, y =1000, z =7} -- Posição da área (de) local toPos = {x =2000, y =2000, z =7} -- Posição da área (até) local actionID = 2520 -- Action ID que você colocará no Teleporte local players = getPlayerInArea(fromPos, toPos) if isPlayer(cid) then if item.actionid == actionID then if #players > 1 then doTeleportThing(cid, fromPosition) end end end return true end Bem, tenta esse... se houver algum erro no distro, printa, e me mande. Bote da forma que eu coloquei. Testei, não deu também, sem erros na distro.
Postado Maio 10, 2014 11 anos Mostra como está a Tag do seu movement.xml. 愛"A alma permanece em suas criações" 平(Não dou suporte por mensagem privada.)
Postado Maio 10, 2014 11 anos Autor Mostra como está a Tag do seu movement.xml. <movevent event="StepIn" actionid="2520" script="TP.lua"/>
Postado Maio 10, 2014 11 anos local function getPlayerInArea(fromPos, toPos) local online = getPlayersOnline() local players = {} for i=1, #online do if isInArea(getPlayerPosition(online[i]), fromPos, toPos) then players[#players+1] = online[i] end end return players end function onStepIn(cid, position, fromPostion, toPosition) local teleportPos = {x = 3000, y = 3000, z = 7} local fromPos = {x =1000, y =1000, z =7} -- Posição da área (de) local toPos = {x =2000, y =2000, z =7} -- Posição da área (até) local actionID = 2520 -- Action ID que você colocará no Teleporte local players = getPlayerInArea(fromPos, toPos) if isPlayer(cid) then if item.actionid == actionID then if #players > 1 then doTeleportThing(cid, fromPosition) else doTeleportThing(cid, teleportPos) end end end return true end Bem, configure a posição do "teleportPos" para posição que o teleport deverá levar, que eu adicionei no Script... E não se esqueça de remover as posições do Teleport configurada no Map editor! 愛"A alma permanece em suas criações" 平(Não dou suporte por mensagem privada.)
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.