I have a bool stored in my playerstate that is IsCarryingFlag (it defaults to false)
When the player picks up an item, I set IsCarryingFlag to true (SetFlagOnServer)
When the player takes enough damage and dies, I fire from the actor (BP_FirstPersonCharacter) a function (IsCarryingFlag?) on the Player Controller (BP_FirstPersonPlayerController)
If the variable on the player state (IsCarryingFlag) == true, then it will drop the item and set IsCarryingFlag to false (SetFlagOnServer)
For some reason, I cannot get it to read the IsCarryingFlag variable correctly, and it just defaults to false meaning nothing get dropped on the client. On the server however, it drops it correctly.
I haven’t looked through everything thoroughly yet, but in the first screenshot I can see that SetPlayerFlag has nothing pinned to PlayerState parameter. Should it be like that?
Ok, I see you are using functions like “GetPlayerController” with Index as parameter. These functions might be harmful in Multiplayer code. You can read how to change them to the right ones in this article - Unreal Engine Multiplayer Tips and Tricks - WizardCell. It might be the reason why it works on the Server.
Firstly, you should not use GetPlayerState by Index or GetPlayerController by Index when you don’t have to. You should always try to find the current player’s Controller or State.
Secondly, you do not grasp how replication works. You should try looking into it again. RPCs are not necessary here and the Client should NEVER be responsible for setting its own values (only exception is when doing net prediction).
All you need is for the Flag Boolean to be Replicated using Rep Notify. When the server sets this Value, the Client will automatically get the new state and call a function called RepNotify_Flag. You can use this function to apply any aesthetic effects for the client.