Ir para conteúdo

Featured Replies

Postado

ta acusando attempt to call field '?' (a nil value) na linha do table.insert(t, pos) , segue script abaixo

Mostrar conteúdo oculto

 

Postado
  • Diretor
  Em 28/01/2017 em 22:46, matheus9712 disse:

ta acusando attempt to call field '?' (a nil value) na linha do table.insert(t, pos) , segue script abaixo

Mostrar conteúdo oculto

 

 

 

local t = {}
    local m = getThingPosWithDebug(cid)
        for x = -7, 7 do
            for y = -7, 7 do
            local pos = {x = m.x + x, y = m.y + y, z = m.z, stackpos = 0}
                if getTileThingByPos(pos).itemid > 0 then
                end
            end
        end
    local function doEarthquake(cid, pos)
        if not isCreature(cid) then return true end
    if not isSightClear(getThingPosWithDebug(cid), pos, false) then return true end
    if not canWalkOnPos(pos, false, false, false, false, true) then return true end
    doAreaCombatHealth(cid, GROUNDDAMAGE, pos, 0, -min, -max, 255)
    doSendMagicEffect({x = pos.x + 1, y = pos.y + 1, z = pos.z}, 127)
    end
    for a = 1, #t do
        if #t >= 1 then
        local random = math.random(1, #t)
        addEvent(doEarthquake, a * 24, cid, t[random])
        t = doRemoveElementFromTable(t, t[random])
        end
    end

 

Postado
  • Autor
  Em 29/01/2017 em 11:23, Alexy Brocanello disse:

 

 


local t = {}
    local m = getThingPosWithDebug(cid)
        for x = -7, 7 do
            for y = -7, 7 do
            local pos = {x = m.x + x, y = m.y + y, z = m.z, stackpos = 0}
                if getTileThingByPos(pos).itemid > 0 then
                end
            end
        end
    local function doEarthquake(cid, pos)
        if not isCreature(cid) then return true end
    if not isSightClear(getThingPosWithDebug(cid), pos, false) then return true end
    if not canWalkOnPos(pos, false, false, false, false, true) then return true end
    doAreaCombatHealth(cid, GROUNDDAMAGE, pos, 0, -min, -max, 255)
    doSendMagicEffect({x = pos.x + 1, y = pos.y + 1, z = pos.z}, 127)
    end
    for a = 1, #t do
        if #t >= 1 then
        local random = math.random(1, #t)
        addEvent(doEarthquake, a * 24, cid, t[random])
        t = doRemoveElementFromTable(t, t[random])
        end
    end

 

o erro sumiu, mas o agora o ataque simplesmente não aparece nada pois vc tirou do script o comando de adicionar as áreas dele na table @Alexy Brocanello

Postado
t = {}
local m = getThingPosWithDebug(cid)
for x = -7, 7 do
	for y = -7, 7 do
		local pos = {x = m.x + x, y = m.y + y, z = m.z, stackpos = 0}
		if getTileThingByPos(pos).itemid > 0 then
			t[#t+1] = pos
		end
	end
end
local function doEarthquake(cid, pos)
	if not isCreature(cid) then return true end
	if not isSightClear(getThingPosWithDebug(cid), pos, false) then return true end
	if not canWalkOnPos(pos, false, false, false, false, true) then return true end
	doAreaCombatHealth(cid, GROUNDDAMAGE, pos, 0, -min, -max, 255)
	doSendMagicEffect({x = pos.x + 1, y = pos.y + 1, z = pos.z}, 127)
end
if #t > 0 then
	for a = 1, #t do
		local random = math.random(1, #t)
		addEvent(doEarthquake, a * 24, cid, t[random])
		t = doRemoveElementFromTable(t, t[random]) -- pra que essa função? existe table.insert e table.remove kk
	end
end  

 

teste desse jeito

Postado
  • Autor
  Em 29/01/2017 em 11:55, Vodkart disse:

t = {}
local m = getThingPosWithDebug(cid)
for x = -7, 7 do
	for y = -7, 7 do
		local pos = {x = m.x + x, y = m.y + y, z = m.z, stackpos = 0}
		if getTileThingByPos(pos).itemid > 0 then
			t[#t+1] = pos
		end
	end
end
local function doEarthquake(cid, pos)
	if not isCreature(cid) then return true end
	if not isSightClear(getThingPosWithDebug(cid), pos, false) then return true end
	if not canWalkOnPos(pos, false, false, false, false, true) then return true end
	doAreaCombatHealth(cid, GROUNDDAMAGE, pos, 0, -min, -max, 255)
	doSendMagicEffect({x = pos.x + 1, y = pos.y + 1, z = pos.z}, 127)
end
if #t > 0 then
	for a = 1, #t do
		local random = math.random(1, #t)
		addEvent(doEarthquake, a * 24, cid, t[random])
		t = doRemoveElementFromTable(t, t[random]) -- pra que essa função? existe table.insert e table.remove kk
	end
end  

 

teste desse jeito

@Vodkart mano, valew mesmo, sensacional, REP++:wow:

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

Informação Importante

Confirmação de Termo