~Edited
Tente usar este script:
local aar = {
[2] = {lookType = 367}, -- Teste
[24] = {lookType = 367}, -- Shino
[39] = {lookType = 367}, -- Shino
[54] = {lookType = 367}, -- Shino
[109] = {lookType = 330} -- Deidara
}
local aterra = {
[2] = {lookType = 160}, -- Teste
[24] = {lookType = 367}, -- Shino
[39] = {lookType = 367}, -- Shino
[54] = {lookType = 367}, -- Shino
[109] = {lookType = 160} -- Deidara
}
function onSay(cid, words, param, channel)
local oar = getCreaturePosition(cid)
local oterra = getCreaturePosition(cid)
local pos = getThingPos(cid)
pos.z = pos.z-1
pos.stackpos = 0
if getTileThingByPos(pos).itemid >= 1 or getTileItemById(getThingPos(cid), 1386).itemid >= 1 then
doPlayerSendCancel(cid, "You can\'t fly through constructions.")
return false
end
if getTilePzInfo(getCreaturePosition(cid)) then
return doPlayerSendCancel(cid, "O item nao tem poder em Protection Zones.")
elseif getPlayerStorageValue(cid, 1635215) <= 0 then
local voc_id = getPlayerVocation(cid)
doSetCreatureOutfit(cid, aar[voc_id], -1)
noar = {x=oar.x, y=oar.y, z=oar.z}
noar.y = noar.y - 0
noar.z = noar.z - 2
doTeleportThing(cid,noar)
doPlayerSendCancel(cid, "Você está voando, tome cuidado.")
doSendMagicEffect(noar, CONST_ME_WATERSPLASH)
setPlayerStorageValue(cid, 1635215, 1)
else
if getPlayerVocation(cid) > 0 then
local voc_id = getPlayerVocation(cid)
doSetCreatureOutfit(cid, aterra[voc_id], -1)
naterra = {x=oterra.x, y=oterra.y, z=oterra.z}
naterra.y = naterra.y - 0
naterra.z = naterra.z + 2
doTeleportThing(cid,naterra)
doPlayerSendCancel(cid, "Você saiu do ar.")
doSendMagicEffect(naterra, CONST_ME_POFF)
setPlayerStorageValue(cid, 1635215, -1)
end
end
return true
end





info
Grupo: Barão
Registrado: 26/12/11
Posts: 201
Reputação: +18
Char no Tibia: Flaah
Ola amigos do Xtibia, eu tenho esse Fly System que eu fiz, mais eu queria que ele não funcionasse caso estivesse um piso ou teto acima do player, caso tenha, apareceria uma mensagem falando que não pode uzar o Fly.
Script:
local aar = { [2] = {lookType = 367}, -- Teste [24] = {lookType = 367}, -- Shino [39] = {lookType = 367}, -- Shino [54] = {lookType = 367}, -- Shino [109] = {lookType = 330} -- Deidara } local aterra = { [2] = {lookType = 160}, -- Teste [24] = {lookType = 367}, -- Shino [39] = {lookType = 367}, -- Shino [54] = {lookType = 367}, -- Shino [109] = {lookType = 160} -- Deidara } function onSay(cid, words, param, channel) local oar = getCreaturePosition(cid) local oterra = getCreaturePosition(cid) if getTilePzInfo(getCreaturePosition(cid)) then return doPlayerSendCancel(cid, "O item nao tem poder em Protection Zones.") elseif getPlayerStorageValue(cid, 1635215) <= 0 then local voc_id = getPlayerVocation(cid) doSetCreatureOutfit(cid, aar[voc_id], -1) noar = {x=oar.x, y=oar.y, z=oar.z} noar.y = noar.y - 0 noar.z = noar.z - 2 doTeleportThing(cid,noar) doPlayerSendCancel(cid, "Você está voando, tome cuidado.") doSendMagicEffect(noar, CONST_ME_WATERSPLASH) setPlayerStorageValue(cid, 1635215, 1) else if getPlayerVocation(cid) > 0 then local voc_id = getPlayerVocation(cid) doSetCreatureOutfit(cid, aterra[voc_id], -1) naterra = {x=oterra.x, y=oterra.y, z=oterra.z} naterra.y = naterra.y - 0 naterra.z = naterra.z + 2 doTeleportThing(cid,naterra) doPlayerSendCancel(cid, "Você saiu do ar.") doSendMagicEffect(naterra, CONST_ME_POFF) setPlayerStorageValue(cid, 1635215, -1) end end return true endVALENDO +REP
Editado Dezembro 9 por Flaah