[solved] is there a better way to code this?
Posted: Thu Jul 05, 2018 7:48 pm
i am trying to remove blocks in these three coordinates. this is the best working solution i came come up with:
i have no clue how to code a better working version of this. i tried something like this: however, it won't work for some odd reason. i know my solution looks trash coding-wise, but other shortcuts just don't work. i have no clue why either. ¯\_(ツ)_/¯
Code: Select all
for x,b in ipairs(blocks) do
if (b.tx == 99 or b.tx == 101 or b.tx == 103) and b.ty == 11 then
table.remove(blocks,x)
end
end
for y,c in ipairs(blocks) do
if c.tx == 101 and c.ty == 11 then
table.remove(blocks,y)
end
end
for z,d in ipairs(blocks) do
if d.tx == 103 and d.ty == 11 then
table.remove(blocks,z)
end
end
Code: Select all
if (b.tx == 99 or b.tx == 101 or b.tx == 103) and b.ty == 11 then