Need help defining a scripting problem so I can make a solution

I have 6 gates dividing each zone so as the player progresses through the game they can buy the gates and then go through them. I figured each gate then would need to be saved in the datastore as either a boolean or value so the player can save the gates status between sessions.

I decided to start with a proximity prompt which would activate a function which would then check the currency is available and then subtract the currency from the players total and turn off the gate which could then be saved to a value or boolean in the datastore. That did not work as the proximity prompt was too high to make it useful to the player even when the Y location was supposedly in front of the player (it bugged out and was only visible when the player looks straight up).

So I made a GUI that is activated when the player touches the gate. I then wondered whether I needed the same GUI copied for every gate or one GUI attached called from many gates (this confuses my little brain as I would need to find a way to determine which gate activated the GUI) and also waiting for the player to click either yes or cancel (which seems overly complicated).

I then realized I would need to make some kind of table with all the gates and their boolean values but still have no way to let the player decide whether to unlock said gate or not. I’m probably overthinking the problem now as other simulator games seem to have made custom prompts attached to GUI’s which then save their status between game sessions.

I’ve lost myself now and I need another way to look at the problem.

Problem:
Make a gate that is activated by prompt, checks the players cash reserves, removes the cost and saves the the gates state (is open, is closed).