But they should not appear be created to a certain area(red zone)
How can I do it? All my attempts were failed
I hope this picture explains:
Code: Select all
script.on_event(defines.events.on_tick, function(event)
local interval = 10 * 60 * 1
if game.tick >= interval then
if (game.tick % interval) == 0 then
game.print{"msg.intro"}
for y=-1,1 do for x=-1,1 do
thisX = math.random(-222,-100) thisY = math.random(-222,-100)
thisXa = math.random(100,222) thisYa = math.random(100,222)
thistiletype = game.surfaces.nauvis.get_tile(thisX, thisY).name
if thistiletype ~= "water" and thistiletype ~= "deepwater" then
game.surfaces.nauvis.create_entity({ name="spitter-spawner", amount=1, position={math.random(thisX,thisXa),math.random(thisY,thisYa)}})
end
end
end
end
end
end)