LUA/Command Help Plz!!

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Marlfox
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu Apr 28, 2016 9:18 pm
Contact:

LUA/Command Help Plz!!

Post by Marlfox »

So we're in version 0.12.29 (Build 17931, win64, steam) and not a single command on my multiplayer server is working. Am I missing something and, if so, what do I have to do to get it to work again? I want to be able to change the colors of the players on my server.
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: LUA/Command Help Plz!!

Post by daniel34 »

You need to enable commands for multiplayer, they are disabled by default.
The checkbox is on the same screen where you set the latency and is called "Allow commands".

If you are running an actual server (using the --start-server option) they are enabled by default, unless you use the option --disable-commands.

Only the host can change this setting, and it's the same setting for all players, including the host.
quick links: log file | graphical issues | wiki
Neemys
Filter Inserter
Filter Inserter
Posts: 461
Joined: Sat Apr 09, 2016 6:16 pm
Contact:

Re: LUA/Command Help Plz!!

Post by Neemys »

If you have command enabled (see post before mine to enable them) it may be because command in multiplayer differ a bit from single player command.

In multiplayer as there is multiple player, you need to give the command the id of the player you want to run the command on :

Code: Select all

/c game.players[1].color={g=50,b=200,r=200,a=.9}
will change the color of the first player connected to the game. change 1 by other number to get other player. There must be another solution to get player by name but I don't know it sorry.


If you have other command to run, when you see "game.player" in single player command, in multiplayer it is "game.players[number]" (notice the s in players)


If you still struggle to get command working, give the command you try and the error message. It will be easier to help you.
Want more space restriction ? Or maybe you want to be forced to use train for other thing than ore and oil ? Try Building Platform Mod !
Post Reply

Return to “Gameplay Help”