First you said the actor needs to spawn on the server then:
if (Role == ROLE_Authority)
{
// spawn the actor
}
since all clients need to see this actor, this actor must have
bReplicates = true;
in the constructor,
Second you said there are some stuff that is needed to be executed on the clients, to do this fill the
void ClassName::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
// fill this function with variables that can be updated during the game and make sure to replicate what is needed to save bandwidth
DOREPLIFETIME(…...);
}
At this point anything happens on the server can be seen by all clients but no client to server communication has been built yet, now use the replicated variables to do some stuff on clients
If a client need to tell server something then you need to use RPC, once it is done on the server make sure to replicate the necessary information to other clients to make them sync with this client
or use ReplicatedUsing specifier to do the syncing.
Hope that helped.