How to make a math.random choose between a different variable?
So I want this poster to change words. There are 8 adjectives and 8 nouns. Each variable before the mousebutton1click function starts looks like this
01 | adjective 1 = script.Parent.Parent.Base.youare.Adjectives.Frame.chaotic |
02 | adjective 2 = script.Parent.Parent.Base.youare.Adjectives.Frame.fancy |
03 | adjective 3 = script.Parent.Parent.Base.youare.Adjectives.Frame.fierce |
04 | adjective 4 = script.Parent.Parent.Base.youare.Adjectives.Frame.majestic |
05 | adjective 5 = script.Parent.Parent.Base.youare.Adjectives.Frame.powerful |
06 | adjective 6 = script.Parent.Parent.Base.youare.Adjectives.Frame.stunning |
07 | adjective 7 = script.Parent.Parent.Base.youare.Adjectives.Frame.unique |
08 | adjective 8 = script.Parent.Parent.Base.youare.Adjectives.Frame.wholesome |
10 | noun 1 = script.Parent.Parent.Base.youare.Nouns.Frame.cat |
11 | noun 2 = script.Parent.Parent.Base.youare.Nouns.Frame.eagle |
12 | noun 3 = script.Parent.Parent.Base.youare.Nouns.Frame.flower |
13 | noun 4 = script.Parent.Parent.Base.youare.Nouns.Frame.human |
14 | noun 5 = script.Parent.Parent.Base.youare.Nouns.Frame.lion |
15 | noun 6 = script.Parent.Parent.Base.youare.Nouns.Frame.mountian |
16 | noun 7 = script.Parent.Parent.Base.youare.Nouns.Frame.potato |
17 | noun 8 = script.Parent.Parent.Base.youare.Nouns.Frame.tree |
Now I could have made a table, but i didnt feel like it. Now when you do math.random it would choose a number 1,8. The number it gets would be one adjective, and I would make another variable in the function and it would give me one noun. I have not completed the script but please tell me how i would do this.
01 | script.Parent.MouseButton 1 Click:Connect( function () |
02 | local adjective = math.random( 1 , 8 ) |
03 | local noun = math.random( 1 , 8 ) |
05 | if adjective = = 1 then |
06 | adjective 1. TextColor 3 = Color 3. new( 255 , 255 , 255 ) |
07 | adjective 1. TextStrokeColor 3 = Color 3. new( 255 , 255 , 255 ) |
10 | adjective 2. TextColor 3 = Color 3. new( 255 , 255 , 255 ) |
11 | adjective 2. TextStrokeColor 3 = Color 3. new( 255 , 255 , 255 ) |