How to make my array table script work properly with my screenGUI ?
I've got a full-screen GUI and a GUI where you can choose colours to change the background to. I want to make the texts on screen change as well, but theres a long list of them so I tried to make an array. I'm new to scripting and especially tables, so I don't know what I'm doing wrong or how to make this script work. Can someone please help and take a look?
1 | local background = script.Parent.Parent.Parent.Parent.ScreenGui.Frame |
2 | local text = { script.Parent.Parent.Parent.Parent.ScreenGui.Frame.Generate,script.Parent.Parent.Parent.Parent.ScreenGui.Frame.Sentence,script.Parent.Parent.Parent.Parent.Shop.Shop,script.Parent.Parent.Parent.Parent.CustomPhrases.Phrases,script.Parent.Parent.Parent.Parent.Colours.Menu } |
5 | script.Parent.MouseButton 1 Click:connect( function () |
6 | background.BackgroundColor 3 = Color 3. fromRGB( 177 , 0 , 0 ) |
7 | text.TextColor 3 = Color 3. fromRGB( 0 , 0 , 0 ) |
Basically, the script only changes the background colour and not the text
And yes I know it probably isn't the most efficient way by listing script.Parent a bunch, but I'm learning and starting with screen GUIs so please be understanding!