This code:
for i=1, #game.players, 1 do
local playerPositionOre = global.world.find_entities_filtered{name = global.oreType, position = game.players[i].position}
if #playerPositionOre > 0 and game.players[i] and game.players[i].valid and game.players[i].character then
game.players[i].character.damage(global.contactDamage, game.forces.neutral, "acid")
end
end
I think it was written wrong.
It must be, for example:
for i , player in pairs (game.players) do
or
for i , player in pairs (game.connected_players) do
http://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.connected_players