Call on a spesific structure variable child using an object variable value instead of a string

How do I…

Pull a value from a Structure variable child, using an object variable to dictate which exact child to pull from.
I have a (global) structure variable with a child for each player, each having children of their own with various variables I need to apply to player object/scene variables.


Each player object has an “ID” number variable. I want to make it so each player object can apply it’s settings by using it’s ID number in place of the numbers in the structure’s child names.
Something like: … set to: Player. + testplayer.ID + .Name
So if the ID of a player is “1” it would look at Player.1.Name
Or if the ID of a player is “2” it would look at Player.2.Name

What is the expected result

Not having to do this:

What is the actual result

Red Squiggly Line of “I don’t know how to format this”
image

I think the correct format will be Player[ToString(testplayer.ID)].Name

As an FYI, a structure’s keys is text. Even the numbers you use under Player (the 1, 2 etc) are text and not numeric. Which is why when referring to them you need to convert the number to a string.