Is there a simple way compare names of values within an array?

hi ok i have a question related to scripting
i have an array with stuff in order to organize a morph gui i’m making. basically, the array is something like this

["Builderman"] = {
    idle1 = 1234,
    idle2 = 1235,
	... etc
}

i am making a script to transfer this code into GUI, with the data related to this inside the gui button, specifically numbervalues stored inside of the gui button. something like this:

how can i check if the numbervalues and value in the array are called the same thing, so i can transfer the information? because i’d normally just do
button.idle1.Value = Builderman.idle1
but i have tens of these, and writing it all out seems annoying. if there isn’t any other way i’ll do it but if there’s a way like i described, how can i do so?

I hope I understand the question correctly.

button[name].Value=Builderman[name]
Would be a way you could do it.
For example if name=“idle1” then your code will do
button[“idle1”].Value=Builderman[“idle1”] which does the same as
button.idle1.Value = Builderman.idle1

You can use this in combination with loops to avoid having to write the lines one by one.

2 Likes

yeah you understood correctly!! i think i was just overthinking it haha
thank you so much!!!

Haha I remember asking the exact same question once

1 Like

that is not an array that a Dictionary you might want to give this a look sorry for the bump