Ir para conteúdo
  • 0

Teleporte por level


damiaotorres

Pergunta

Posts Recomendados

  • 0

Faz assim:

em movements coloca esse script :

function onStepIn(cid, item, position, fromPosition)

local pos1 = {x = 1027, y = 912, z = 5} -- Posicao que sera levado

 if getPlayerLevel(cid) >= 120 and getPlayerLevel(cid) <= 140 then
    doTeleportThing(cid, pos1)
    setPlayerStorageValue(cid, 190983, 1)
 else
    doPlayerSendCancel(cid, "Voce nao pode entrar nesse Tp.")
    doTeleportThing(cid, fromPosition, true)
 end

return true
end

agora em creaturescripts coloca esse :

function onThink(cid, interval)

local pos = {x= 1, y= 2, z= 3} -- posição pra onde o player vai

if getPlayerLevel(cid) > 140 and getPlayerStorageValue(cid, 190983) >= 1 then
  if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE then
     doTeleportThing(cid, pos)
     setPlayerStorageValue(cid, 190983, 0)
  end
end

 return true
end

com esse script , quando o player passar do level 140, e se ele não tiver com batler o mesmo será teleportado.

 

a tag que vai em login.lua é essa:

registerCreatureEvent(cid, "Nome do Evento")

e a tag que vai em creaturescripts.xml é essa :

 <event type="think" name="Nome do Evento" event="script" value="Nome do Arquivo.lua"/>
Editado por DuuhCarvalho
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...