Ir para conteúdo

Featured Replies

Postado

Em "Data/actions/scripts", magicTeleport.lua:

local t = {
    position = {x = 160, y = 54, z = 7}, -- Posição que o item irá teleportar.
    level = 50,                          -- Level necessário.
    battle = false,                      -- Pode usar em batalha.
    needpz = true,                       -- Só usar em zona de proteção.
    remove = true
}

function onUse(cid, item)
    if t.battle == false and getCreatureCondition(cid, CONDITION_INFIGHT) then
    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Você não pode teleportar em batalha.') and true
    end
	
    if t.needpz == true and not getTilePzInfo((getCreaturePosition(cid))) then
    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Você não pode teleportar fora da zona de proteção.') and true
    end
	
    if getPlayerLevel(cid) >= t.level then
	doTeleportThing(cid, t.position)
	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
    else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Você precisa ser level '.. t.level ..' para teleportar.')
	return true
    end
	
    if t.remove == true then
	doRemoveItem(item.uid, 1)
    end
   return true
end

TAG:

<action itemid="XXX" script="magicTeleport.lua"/>

Não testei pq estou sem base, se der algum erro me avise :).

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.8k

Informação Importante

Confirmação de Termo