The problem is In a replicated function or event like BeginPlay How’ll you know that you are a player who is playing on the same machine that is hosting the listen server and switch/Branch using else if on that ?
Everything in context of listen server
Take the case of Functions and events that are called on both server and clients like Beginplay
for Example case Lets assume we have to send some data to server as a “player” i.e from your Machine or player input.
Now if you use BeginPlay of playerState to send the data you’ll run into following issues.
if you check for Role<Authority then you miss out the player on the server since he’s role Authority on his own machine
if you check for Role == Authority you’ll get the player on the server machine but lose every remote player
if you check NetMode == NM_ListenServer then every player state on the server will have Netmode Listen Server so you’ll actually be calling the functions on server not the client