How do I use custom identifiers?

Ok so the question is related to the following problem in C#. It’s not a ‘my code doesn’t work’ question, rather a ‘which way am I supposed to do this’ question.
I have a GameObject which contains data for four players:

int player01Value;
int player02Value;
int player03Value;
int player04Value;

What I need to do is fetch one of these for use in another script, but we don’t know which one until later.

void someMethod()
    private string fullString;
    private int playerNumber = //a number I get from somewhere.
                          // An int between 01 and 04. In this case 01

    fullString = "player" +playerNumber +"value";

    // fullString is now: "player01value"


void GetTheInfo(string whichPlayerValue)
    int aPlayersIntValue = ScriptA.(whichPlayerValue);

as you can see, the identifier ‘whichPlayerValue’ needs to be defined during the game, since there are four players and we don’t know which player’s value we need until we are given the integer ‘playerNumber’. The period and bracket identifier is obviously not working so I was wondering if somebody could suggest an alternative way to use fullString as the identifier. It would save me copying huge blocks of code just to change one number in each copy. We can’t just Get the int from ScriptB because this is a much-simplified version of a much larger framework. If I get an answer how to do what I’m asking it would be very much appreciated.

I’m not sure I would go this route, because it’s going to be a pretty ugly solution to try and get a value by its field name. How about something like this instead in ScriptA:

public class ScriptA
    public static int[] playerValues = new int[4];

Then simplify ScriptB to this:

void someMethod()
    int playerNumber = 2;   // <-- just for example

void GetTheInfo(int whichPlayerIndex)
    int aPlayerIntValue = ScriptA.playerValues[whichPlayerIndex - 1];

The static part is a matter of how you want to implement it. I added it because of how your ScriptB example was directly trying to reference a class variable.