# OnRep only called on one client

**URL:** <https://forums.unrealengine.com/t/onrep-only-called-on-one-client/143609>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [May 14, 2020, 6:46pm UTC](https://forums.unrealengine.com/t/onrep-only-called-on-one-client/143609 "2020-05-14T18:46:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jssjogren](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jssjogren](https://forums.unrealengine.com/u/jssjogren)\
**Post date:** [May 14, 2020, 6:46pm UTC](https://forums.unrealengine.com/t/onrep-only-called-on-one-client/143609/1 "2020-05-14T18:46:51Z")

</div>

Ok, so a little bit of background. I am attempting to setup multiplayer on our game using a the dedicated server option with 2 players (at the moment).

There is a function that is called client-side on the press of a button. This function that is called on the client, then proceeds to trigger an RPC to the server. Inside this RPC to the server I am spawning an actor which I have an OnRep setup for via ReplicatedUsing. However, the OnRep function is only seemingly executed in one “place”. I can tell because if I print the name of the player controller it is the same each time the OnRep is called, no matter which client initiates this whole flow by pressing a button.

How can I make it so that this OnRep is executed on each individual client?
