I currently have
Code: Select all
for k,nearbyentity in pairs(game.findentities{{event.entity.position.x-5, event.entity.position.y-5}, {event.entity.position.x+5, event.entity.position.y+5}}) do
if nearbyentity.name == "dynamite" then for k,v in pairs(glob.dynamite) do if nearbyentity.equals(v.entity) then glob.dynamite[k].tick=glob.dynamite[k].tick-100 end end
elseif nearbyentity.health then nearbyentity.damage(20, game.player.force)
end
end
Also I noticed that the explosion is not what I expected.... edit: fixed, silly errors lol. had table.remove in two places (moved to only being in onentitydied), the explosions issue (which came from using a landmine type for the dynamite initially) was due to the createentity not being inside of the if name==dynamite block.