I am trying to run an effect for all players when I send a chat command, but it is'nt working.
I have this.
I don't know what is wrong. It works just for the player that send the command.Code:[ChatCommand("a")] void Test(BasePlayer player) { foreach (BasePlayer jugador in BasePlayer.activePlayerList.ToList()) { Effect.server.Run(fxeventobusqueda, player.transform.position); } }
Thanks.
Solved Run effect for all players
Discussion in 'Rust Development' started by Reynostrum, Jan 7, 2016.
-
Code:
[ChatCommand("a")] void Test(BasePlayer player) { foreach (BasePlayer jugador in BasePlayer.activePlayerList.ToList()) { Effect.server.Run(fxeventobusqueda, jugador.transform.position); } }
-
Thank you!
-
Just as a side thought, you dont need .ToList() - activePlayerList is already a list