|
| 31 Aug 2016 05:00 PM |
Choices = {'New','Import','Export'}
local ChoiceColors = { ['New'] = Color3.new(85, 255, 127), ['Import'] = Color3.new(0/255,0/255,0/255), ['Export'] = Color3.new(0/255,0/255,0/255), }
for i,choice in pairs(Choices) do button = ...i have it defined already no problem button.TextColor3 = ChoiceColors[choice] end
i want to do it without writing bunch of if statement's, but its throwing me and error: attempt to index local 'Color3' (a function value)
How would i fix this? Thanks |
|
|
| Report Abuse |
|
|
badfitz67
|
  |
| Joined: 03 Jun 2010 |
| Total Posts: 13165 |
|
|
| 31 Aug 2016 05:03 PM |
try: for i,choice in pairs(ChoiceColors) do button = ...i have it defined already no problem button.TextColor3 = choice end
All these questions have driven me into existential angst and I find myself beginning to question myself and my motives |
|
|
| Report Abuse |
|
|
|
| 31 Aug 2016 05:05 PM |
| No ur missing the point im first getting the choice from list and according to choice name im setting the choicebutton color from the ChoiceColors table |
|
|
| Report Abuse |
|
|
|
| 31 Aug 2016 05:06 PM |
attempt to index local 'Color3'
are you 100% sure you did not name any function Color3? |
|
|
| Report Abuse |
|
|
|
| 31 Aug 2016 05:12 PM |
| Yes i did , but now its saying trying to index Color3 a table value i removed the function called Color3. |
|
|
| Report Abuse |
|
|
|
| 31 Aug 2016 05:13 PM |
you need to make sure that nothing else has the name of "Color3" and then use
Color3.fromRGB(r,g,b) to store them |
|
|
| Report Abuse |
|
|
|
| 31 Aug 2016 05:19 PM |
Okey this is my code now and i dont' have anything named Color3 how would i make this work?
Its saying:attempt to call global 'Color3' (a table value)
local ChoiceColors = { ['New Animation'] = Color3.fromRGB(85/255, 255/255, 127/255), ['Import'] = Color3.fromRGB(0/255,0/255,0/255), ['Export'] = Color3.fromRGB(0/255,0/255,0/255), }
for i,choice in pairs(Choices) do button = ...i have it defined already no problem button.TextColor3 = ChoiceColors[choice] end
|
|
|
| Report Abuse |
|
|
|
| 31 Aug 2016 05:20 PM |
attempt to call global 'Color3'
because you are doing
Color3()
somewhere
i dont know why you are -.- |
|
|
| Report Abuse |
|
|
|
| 31 Aug 2016 05:22 PM |
| It's not i deleted the function called Color3, i think the problem now is it doesn' tseem to get the color3 value from the table |
|
|
| Report Abuse |
|
|
|
| 31 Aug 2016 05:42 PM |
| Never mind got it, did call color3 lol thanks for help |
|
|
| Report Abuse |
|
|