Ola Eks Tibianos, Vim postar um Script de Fly System dando Use em Um Item!!!
Voce esta se Perguntando!! Nummm Item????
Isso Mesmo!!
Talkaction Explicaçao:
/flyup = Verifica se tem o Piso itemid= 260 que é o Tile Invisivel e ve se nao tem nada acima para voce subir!!
/flydown = Verifica se tem tem algo que voce nao pode descer como arvores paredes e etc....
-------------
Action Explicaçao: Voce da Use no Item e Sobe a Cima no Tile! ou Descee!!
vá em Data>Actions>Scripts crie uma pasta.lua chamada actionfly e coloque isso:
local t = {
[150] = {outfit='dragon', text='Fly, dragon!', dtext='Go down, dragon!'} -- Falas
}
local thisCondition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(thisCondition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(thisCondition, {lookType = 32, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0}) -- Outfit
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v, r, s = getCreaturePosition(cid), t[item.itemid], 100
local pos = {x = v.x, y = v.y, z = 6} ----- Onde ele Precisa para dar Down -- Pode Modificar do 0 ao 7
local posd = {x = v.x, y = v.y, z = 7} ---- Onde ele Precisa para Dar Up -- Pode Modificar do 7 ao 0
if r then
if v.z == 7 then
if getTileItemById(pos, 460).uid > 0 then -- id do tile
if doTeleportThing(cid, pos, false) then
doSendMagicEffect(pos, 10) -- efeito
doCreatureSay(cid, r.text, 19)
return doAddCondition(cid, thisCondition)
else
return doPlayerSendCancel(cid, 'You can\'t fly here.')
end
else
return doPlayerSendCancel(cid, 'You can\'t fly here.')
end
elseif v.z == 6 then
if doTeleportThing(cid, posd, false) then
doSendMagicEffect(posd, 10) -- efeito
doCreatureSay(cid, r.dtext, 19)
return doRemoveCondition(cid, CONDITION_OUTFIT)
else
return doPlayerSendCancel(cid, 'You can\'t land here.')
end
else
return doPlayerSendCancel(cid, 'You can\'t fly here.')
end
else
return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'There has been some error, try contacting a staff member.')
end
end
Ok Acabamos... Uffa agora vamos ao Action.xml Adicione Isso:
<action itemid="SEU ITEM" event="script" value="actionfly.lua"/>
Ok Agora vamos em Talkaction...
Vá em Data>Talkactions>Scripts crie uma pasta.lua chamada flyinfo e Adicione isso:
local s = {
{100}
}
local water = {4608,4609,4610,4611,4612,4613,4614,4615,4616,4617,4618,4619,4664,4665,4666,5757,5756,5755,5759,5760,5758,5761}
function onSay(cid,words,param)
for _,i in ipairs(s) do
local r = i[1]
local v = getThingPos(cid)
local up,down = {x=v.x,y=v.y,z=v.z-1},{x=v.x,y=v.y,z=v.z+1}
if words == '/flyup' then
if getPlayerStorageValue(cid,r) > 0 then
if getTileItemById(up,460).uid > 0 then
doPlayerSendTextMessage(cid,20,'[Flying] You have flown up.')
doSendMagicEffect(up,10)
doCreatureSay(cid,'Up!',19)
doTeleportThing(cid,up)
return doSendMagicEffect(up,10)
else
doPlayerSendTextMessage(cid,20,'[Flying] You can\'t fly here.')
end
else
doPlayerSendTextMessage(cid,20,'[Flying] You aren\'t mounted.')
return true
end
elseif words == '/flydown' then
if getPlayerStorageValue(cid,r) > 0 then
if v.z >= 7 == false then
if getHouseFromPos(down) == false then
if(getTileItemById(down,(isInArray(water,itemid)),false).uid) then
if getTileItemById(v,460).uid > 0 then
doPlayerSendTextMessage(cid,20,'[Flying] You have flown down.')
doSendMagicEffect(down,10)
doCreatureSay(cid,'Down!',19)
doTeleportThing(cid,down)
return doSendMagicEffect(down,10)
else
doPlayerSendTextMessage(cid,20,'[Flying] You can\'t fly into ground.')
end
else
doPlayerSendTextMessage(cid,20,'[Flying] You can\'t fly on water.')
end
else
doPlayerSendTextMessage(cid,20,'[Flying] This is a house!')
end
else
doPlayerSendTextMessage(cid,20,'[Flying] You can\'t fly into ground.')
end
else
doPlayerSendTextMessage(cid,20,'[Flying] You aren\'t mounted!')
return true
end
end
return true
end
end
Ufa, Agora vamos a Data>Talkactions.xml e Adicione Isso!!
<talkaction words="/flyup;/flydown" event="script" value="flyinfo.lua"/>
Creditos:
Google Tradutor
unknown666
Gostou do Script? Rep+
Duvidas, Elogios neste Topico!!
Abraços..