Need game CollectionService logic help

I’m just practicing with CollectionService and taggedParts. For now lets call them button1, button2, button3, button4.

I’m using a touch event to determine which button I actually touched and each button has a value, lets say value = 1. The datastore also has variables inside leaderstats.stat1, stat2,stat3,stat4.

the logic is thus,
button1.value > stat1.value
button2.value > stat2.value
etc…

I’m attempting to connect button1 with stat1 but since the names (button1 and stat1) are different I’ve no way “that I can think of” to use logic to connect them. I decided to add to the button.config folder to each button and a button1.config.stringValue.value[stat1] with the exact same name as the leaderstats.stat1, stat2 etc, but the further down the script I go the more difficult it’s getting to keep track of all the different paths for the buttons and stats are taking. The buttons also upgrade other buttons using different currencies etc and I’m getting very frustrated.

Is there a better game logic that would work for something like this??

What’s happening at the moment
Example. Player touches button1, the code loops through the list of tagged buttons to see which was touched, checks the cost of the button, finds the main currency of the player, takes the button.config.stringValue = “stat1” and loops through the leaderstats folder until leaderstats.stat1 is found, breaks the loop and sets the variable statFound to true…then I’m not sure as it’s getting confusing…

Somewhere in the code I have to check to make sure that the stringvalue.value == stat1.Name is actually the one I’m looking for, go to the library of data[module] in serverscriptservice, find that button in the table of data, check the cost and reward, reward the player by updating the leaderstats.stat1 and idk what else…my heads going to explode.

Anyway I think I should stop, rid myself of all this confusing logic and find a better logic that’s easier to understand.