You need to send a RPC (RunOnServer event) from an Actor that the client sending it already owns like the owned PlayerController or the possessed Pawn etc. Then when you successfully sent the RPC you can set the replicated variable by the server from there.