MODの作り方/getdirection

Last-modified: 2016-06-29 (水) 11:41:07
Version0.13現在の情報です

ソース

script.on_event(defines.events.on_built_entity, function(event)
  local entity = event.created_entity.direction
  local player = game.players[event.player_index]
  if entity==defines.direction.north then
    player.print("北向き")
  elseif entity==defines.direction.south then
    player.print("南向き")
  elseif entity==defines.direction.east then
    player.print("東向き")
  elseif entity==defines.direction.west then
    player.print("西向き")
  else
    player.print(entity)
  end
end)