Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Como posso utilizar um addevent para remover certa storage sem ta erro quanto nao tem o summon pokemon?

 

ate fiz essa funçao pra ver mais sempre ta o erro (luaDoCreatureSetStorage) Creature not found

 

 

function doResetStorageValue(cid, time, storage, value)


if not isCreature(cid) then return true end
addEvent(setPlayerStorageValue, time, cid, storage, value)
end

 

obs tb usei assim e deu erro

 

function doResetStorageValue(cid, time, storage, value)


if  isCreature(cid) then
addEvent(setPlayerStorageValue, time, cid, storage, value)

end
end

Editado por nociam (veja o histórico de edições)

Resolvido por nociam

Ir para solução
  • Respostas 5
  • Visualizações 1.2k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Tenta. function doResetStorageValue(cid, time, storage, value) if isCreature(cid) then return addEvent(function() setPlayerStorageValue(cid, value, storage) end, time) end end local

  • function doResetStorageValue(cid, time, storage, value) if isCreature(cid) then return false end return addEvent(function() setPlayerStorageValue(cid, value, storage) end ,time) end Manda o script

  • Obrigado, tb percebi que tava usando errado o addEvent eu deveria ter feito assim   function teste(cid) if isCreature(cid) then   setPlayerStorageValue(cid, 21103, -1) end end   ai chamar o ad

Postado
function doResetStorageValue(cid, time, storage, value)
if isCreature(cid) then
 return false
end
 return addEvent(function() setPlayerStorageValue(cid, value, storage) end ,time)
end

Manda o script inteiro, se não der...

Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado).

 

Tópicos:


 

yNlhRVC.png

 

55px-Judo_yellow_belt.svg.png

Postado
  • Autor

resolvido por base na sua.

function doResetStorageValue(cid)


if isCreature(cid) then
setPlayerStorageValue(cid, 4440929, 1)
addEvent(function() if isCreature(cid) then setPlayerStorageValue(cid, 4440929, -1) end end, 2000)
end
end

Editado por nociam (veja o histórico de edições)

Postado

Tenta.

function doResetStorageValue(cid, time, storage, value)
    if isCreature(cid) then
        return addEvent(function() setPlayerStorageValue(cid, value, storage) end, time)
    end
end

local signal = {[NORTH] = {0, -1}, [SOUTH] = {0, 1}, [EAST] = {1, 0}, [WEST] = {-1, 0}}
local d = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
local p = getThingPosWithDebug(cid)
local t = {}

for b = 1, 6 do
    local pos = getThingPositionWithDebug(cid)
    pos.x = pos.x + signal[d][1] * b
    pos.y = pos.y + signal[d][2] * b
    if canWalkOnPos(pos, false, true, true, true, false) and isSightClear(getThingPositionWithDebug(cid), pos, false) then
        table.insert(t, pos)
    end
end
    
if #t <= 0 then return true end

function doAquaJet(cid, area, areaEff, eff, pos, a)
    if not isCreature(cid) then return true end
    if not pos then return true end
    doAreaCombatHealth(cid, WATERDAMAGE, areaEff, 0, 0, 0, eff)
    doAreaCombatHealth(cid, WATERDAMAGE, area, whirl3, -min, -max, 0)
    doTeleportThing(cid, pos, true)
    -- if a == 6 then // essa opçao pra tirar a storage eu eliminei porque se o pokemon parar antes de terminar o for a storage tb nao sae
    -- setPlayerStorageValue(cid, 4440929, -1)
    --end )
end

for a = 0, 6 do

    local AquaJet = {
        [0] = {675, {x=p.x, y=p.y-(a+0), z=p.z}, {x=p.x+1, y=p.y-(a-2), z=p.z}}, --pra cima
        [1] = {673, {x=p.x+(a+0), y=p.y, z=p.z}, {x=p.x+(a+0), y=p.y+1, z=p.z}}, --direito
        [2] = {674, {x=p.x, y=p.y+(a+0), z=p.z}, {x=p.x+1, y=p.y+(a+0), z=p.z}}, --baixo
        [3] = {676, {x=p.x-(a+0), y=p.y, z=p.z}, {x=p.x-(a-2), y=p.y+1, z=p.z}} --esquerdo
    }

    addEvent(doAquaJet, 310*a, cid, AquaJet[d][2], AquaJet[d][3], AquaJet[d][1], t[a], a)
end

doResetStorageValue(cid, 2000, 4440929, -1)
setPlayerStorageValue(cid, 4440929, 1)
addEvent(doDisapear, 180, cid)
addEvent(doAppear, 1950, cid, 0)
                              _
                          .-'` `}
                  _./)   /       }
                .'o   \ |       }
                '.___.'`.\    {`
                /`\_/  , `.    }                                      ME DA UMA NOZ!
                \=' .-'   _`\  {
                 `'`;/      `,  }
                    _\   @   ;  }
                   /__`;-...'--'

Cluck!

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.7k

Informação Importante

Confirmação de Termo