1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00
RedMew/train_station_names.lua
2017-06-13 13:16:07 +02:00

18 lines
475 B
Lua

local function player_built_entity(event)
if event.created_entity.name == "train-stop" then
local y = math.random(1,3)
if y == 1 then
else
local total_players = #game.players
local x = math.random(1,total_players)
local player = game.players[x]
event.created_entity.backer_name = player.name
end
end
end
Event.register(defines.events.on_built_entity, player_built_entity)
Event.register(defines.events.on_robot_built_entity, player_built_entity)