Correct me please. Creating random number

That error means that the “Player” variable is empty when you try to call SetActorLocation on it. Make sure that it contains something before trying to access that something.