I'm trying to make a localscript for inventory management of prizes in my game. They are stored on boolvalues in the player and I'm making the inventory buttons only available if they have previously bought it. The problem I'm having is that in order to make the script efficient for all prizes and not have to write down every individual name, I would have to insert the button's name, same as the value's name, into a game directory:
if game:GetService("Players").LocalPlayer ..script.Parent.Name.. Value == true then
--e
end
Knew from writing it that it wouldn't work. The Value part is thought to be a variable. Is it even possible or does it only work for strings? Is there another solution?

2 comments
Use bracket notation like x[y] to index x with a specific value
I'm dumb I forgot about that