Server 16.6 crash player join
Posted: Wed Dec 20, 2017 7:23 pm
Hi,
Server on 16.6 crashes on player join with error
control lua contains following code:
as I see if game.players[event.player_index] is defined the player object could not be nil
Thx in advance
Server on 16.6 crashes on player join with error
Code: Select all
724.448 Error MainLoop.cpp:1013: Exception at tick 1485741: Error while running event level::on_player_created (ID 24)
....16.6/Factorio_0.16.6/temp/currently-playing/control.lua:17: attempt to call field 'gui_init' (a nil value)
724.450 Error ServerMultiplayerManager.cpp:95: MultiplayerManager failed: "Error while running event level::on_player_created (ID 24)
....16.6/Factorio_0.16.6/temp/currently-playing/control.lua:17: attempt to call field 'gui_init' (a nil value)"
724.451 Info ServerMultiplayerManager.cpp:693: mapTick(1485741) changing state from(InGame) to(Failed)
as I see if game.players[event.player_index] is defined the player object could not be nil
Code: Select all
script.on_event(defines.events.on_player_created, function(event)
local player = game.players[event.player_index]
player.insert{name="iron-plate", count=8}
player.insert{name="pistol", count=1}
player.insert{name="firearm-magazine", count=10}
player.insert{name="burner-mining-drill", count = 1}
player.insert{name="stone-furnace", count = 1}
player.force.chart(player.surface, {{player.position.x - 200, player.position.y - 200}, {player.position.x + 200, player.position.y + 200}})
if (#game.players <= 1) then
game.show_message_dialog{text = {"msg-intro"}}
else
player.print({"msg-intro"})
end
silo_script.gui_init(player)
end)
Thx in advance