You should post what you have tried and why it doesn’t work. You would need to create a server function to serve this purpose or just work off of existing functions such as BeginPlay. (ran on client and server). Just make sure you check if you have authority if you are going to spawn through begin play.
But to make your own function.
UFUNCTION(Server, Reliable, WithValidation)
SpawnCharacter();
void SpawnCharacter_Implementation()
{
//spawn function
//APawn* SpawnedPawn = GetWorld()->SpawnActor(pawnclass, transform,spawn info);
//Possess(SpawnedPawn);
}
bool SpawnCharacter_Validate()
{
return true;
}
if this still doesn’t work, check if your pawn is replicated.
On a side note, you should check out some of the free resources available made by Epic such as ShooterGame. It will teach you the basics.