Code: Select all
local player = game.getplayer(event.playerindex)
local pos = player.position
local entities = game.findentitiesfiltered{
area = {{ pos.x - 32, pos.y - 32 }, { pos.x + 32, pos.y + 32 }},
name = "basic-transport-belt"
}
for i = 1,#entities do
local entity = entities[i]
entity.orderdeconstruction(player.force)
game.createentity{
name = "ghost",
innername = "fast-transport-belt",
position = entity.position,
direction = entity.direction,
force = player.force
}
end
Code: Select all
/c game.createentity{ name = "ghost", innername = "fast-transport-belt", position = game.player.position, direction = 0, force = game.player.force }
Creating normal entities:
Code: Select all
/c game.createentity{ name = "fast-transport-belt", position = game.player.position, direction = 0, force = game.player.force }