MP problems

Place to get help with not working mods / modding interface.
McGuten
Filter Inserter
Filter Inserter
Posts: 310
Joined: Tue Jun 24, 2014 3:06 pm
Contact:

MP problems

Post 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
Image
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3749
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: MP problems

Post 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
McGuten
Filter Inserter
Filter Inserter
Posts: 310
Joined: Tue Jun 24, 2014 3:06 pm
Contact:

Re: MP problems

Post by McGuten »

a lot of thanks dude, i will try it ^^
Image
Post Reply

Return to “Modding help”