Page 1 of 1

MP problems

Posted: Sat Jun 20, 2015 4:51 pm
by McGuten
hey guys, I have a little problem with Factorio MP, I read the string/sentence "game.player" not found on MP version and I use that for "5Dim's Trains". What sentence I should use instead of "game.player"?

Thanks you all

Re: MP problems

Posted: Sat Jun 20, 2015 6:22 pm
by DaveMcW
You can use game.players[1] for testing.

But that means only the first player can use your mod. A better solution is to use the playerindex on events.

Code: Select all

game.onevent(defines.events.onguiclick, function(event) 
	local player = game.players[event.element.playerindex]
	player.print("Hello world")
end

Re: MP problems

Posted: Sat Jun 20, 2015 6:54 pm
by McGuten
a lot of thanks dude, i will try it ^^