You need a list of all your connected players. Create a custom event on your **pawn **or player controller (wherever your **HUD **is) and set the custom event’s **Replicates **property to “Run on Owning Client”. Create an input on the custom event to expect a Name, Text or String. When a player connects, iterate through all of your connected players and call this new custom event and pass the name of the connected player.
Your custom event should call a function on the HUD that adds a “[player] has connected” message.
My Player Pawn has an event called CL_NewPlayerConnected that expects a Name value (my combat HUD is on my Pawn in this case).
The game should be building a list of all of your connected players. GM_Game is my main Game Mode. The **Event OnPostLogin **triggers anytime a new player connects to the **Level **that is using this Game Mode. This event gives you a controller - you can cast it to whatever your player controller is. Mine is called PC_Game. My player controller has a Name variable that stores the name of the player and I pass it to a function called New Player Connected.
IMPORTANT: Make sure you use a function that way anytime a new player logs in, it calls a new “instance” of this function so-to-speak and passes it it’s own **Name **value. If you don’t create a function here and do a ForEachLoop right off of the event, you’ll run into issues when 2 players connect at the same time and the loop hasn’t finished running the code on all HUD’s for the previous player. By separating it into a function, this event runs, gets the name, passes it to a that function and moves on. If another player connects at the same exact time, it calls the function again with a new value, but now you’ll have 2 functions potentially running at the same time to update all HUD’s but each of them has a different Name value so everything will work as expected
The function iterates through all your Players and calls that **CL_NewPlayerConnected **custom event. Remember, this Players array that I have is a list of all of my Pawns.
Hope this helps