e.g.:
Code: Select all
/c
local player = game.player
local surface = player.surface
local position = player.position
player.force.maximum_following_robot_count = 5
local bot_t = {
name = "defender",
surface = surface,
force = "player",
position = position,
target = player.character
}
local player_count = 5
for i = 1, player_count do
surface.create_entity(bot_t)
end
bot_t.force = "neutral"
position.x = position.x + 10
local other_count = 3
for i = 1, other_count do
surface.create_entity(bot_t)
end