Postado Janeiro 28, 2017 8 anos 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 table.insert(t, 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 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 Janeiro 29, 2017 8 anos 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 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 table.insert(t, 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 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 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 Janeiro 29, 2017 8 anos 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 Janeiro 29, 2017 8 anos 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 Janeiro 29, 2017 8 anos 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++
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.