Ir para conteúdo
  • Cadastre-se

Alguem Pode Me Ajuda Numa Script de fly


Posts Recomendados

a script minha de fly esta bugando,quando um player faz uma quest com uma roupa e se ele morrer ou deslogar com aquela roupa buga o fly dele alguem me ajuda

 

Spoiler

local del = {'460', '1022', '1023', '1024'}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)

position.stackpos = 0

if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV

    if getPlayerStorageValue(cid, 17000) <= 0 then
        doTeleportThing(cid, fromPosition, false)
        doRemoveItem(getTileThingByPos(position).uid, 1)
        doPlayerSendCancel(cid, "You can't fly.")
    return true
    end

    doAreaCombatHealth(cid, FLYSYSTEMDAMAGE, getThingPos(cid), splash, 0, 0, 255)

local pos = getThingPos(cid)
    if pos.z == 7 then return true end
pos.z = pos.z + 1

    for i = 0, 255 do
        pos.stackpos = i
        local tile = getTileThingByPos(pos)
        if tile.itemid ~= 0 and not isCreature(tile.uid) then
            if hasProperty(tile.uid, 3) or hasProperty(tile.uid, 7) or tile.itemid == 919 then
                doTransformItem(item.uid, 11677)
            end
        end
    end

return true
end

function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)

if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV

local effect = 2

    if toPosition.z == fromPosition.z and getCreatureOutfit(cid).lookType ~= 316 and getCreatureOutfit(cid).lookType ~= 648 then
        doSendMagicEffect(fromPosition, effect)
    end

local oldtpos = fromPosition
oldtpos.stackpos = STACKPOS_GROUND


if getTileThingByPos(oldtpos).itemid >= 1 then
doRemoveItem(getTileThingByPos(oldtpos).uid, 1)
end

return true
end    

 

Link para o post
Compartilhar em outros sites

Esta é uma mensagem automática! Este tópico foi movido para a área correta.
Pedimos que você leia as regras do fórum.

Spoiler

This is an automated message! This topic has been moved to the correct area.
Please read the forum rules.

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Link para o post
Compartilhar em outros sites

Troca seu sistema por este.

function onSay(cid, words, param)

local config = {
pz = true, -- players precisam estar em protection zone para usar? (true or false)
battle = false, -- players deve estar sem battle (true or false)
custo = false, -- se os teleport irão custa (true or false)
need_level = false, -- se os teleport irão precisar de level (true or false)
vip = true, -- somente vip players poderam usar o comando? ("yes" or "no")
storage = 13500 -- Storage Id da sua vip account caso for usar somente vips
}

--[[ Config lugares]]--
local lugar = {
["depot"] = { -- nome do lugar
pos = {x=1016, y=1045, z=7},level = 8,price = 0},
["temple"] = { -- nome do lugar
pos = {x=1032, y=1016, z=7},level = 8, price = 0},
["arena"] = { -- nome do lugar
pos = {x=1016, y=1052, z=8},level = 8,price = 0},
["viparea"] ={ -- nome do lugar
pos = {x=701, y=1015, z=7},level = 8,price = 0},
["trainer"] ={ -- nome do lugar
pos = {x=965, y=1057, z=7},level = 8,price = 0}
}

--[[ Lista de Viagem (Não mexa) ]]--
if (param == "lista") then
local str = ""
str = str .. "lista de viagem :\n\n"
for name, pos in pairs(lugar) do
str = str..name.."\n"
end
str = str .. ""
doShowTextDialog(cid, 6579, str)
return TRUE
end


local a = lugar[param]
if not(a) then
doPlayerSendTextMessage(cid, 25, "desculpe,este lugar não existe")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
elseif config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.")
return TRUE
elseif config.premium == true and not isPremium(cid) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas players com premium account podem teleportar.")
return TRUE
elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler pra poder teleportar.")
return TRUE
elseif config.need_level == true and getPlayerLevel(cid) < a.level then
doPlayerSendTextMessage(cid, 25, "Desculpe,Voce não tem level. voce precisa "..a.level.." level ou mais para ser teleportado.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
elseif config.custo == true and doPlayerRemoveMoney(cid, a.price) == FALSE then
doPlayerSendTextMessage(cid, 25, "Desculpe,voce nao tem dinheiro suficiente. Voce precisa "..a.price.." gp para ser teleportado.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
elseif config.vip == true and getPlayerStorageValue(cid, tonumber(config.storage))  - os.time() <= 0 then
doPlayerSendTextMessage(cid, 25, "Desculpe,voce nao e Player vip Para Usar o !fly!.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
end
doTeleportThing(cid, a.pos)
doSendMagicEffect(a.pos, CONST_ME_TELEPORT)
doBroadcastMessage("" .. getPlayerName(cid) .. " has flown to " .. param ..  " using !fly." ,MESSAGE_INFO_DESCR)
return TRUE
end

Editado por Joaovettor (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo