2 posts
Posted 08 July 2012 - 02:48 AM
is it possible to turn a string into a command, and then save the output of that command back into a string? for example:
a=read()
a1=("colors."..a)
I want it to run the string "colors.a" and then print the string it outputs to another variable.
1548 posts
Location
That dark shadow under your bed...
Posted 08 July 2012 - 06:44 AM
in this case just use:
local a=read()
local colorcode=colors[a]
the colors command is actually just a table so yeah. other examples are a little harder, try posting your script. then we can help you better
2 posts
Posted 08 July 2012 - 07:04 AM
Ah, Thank you, that helped, I was just trying to make a basic script using read and color to help me understand how the colors api works.
1548 posts
Location
That dark shadow under your bed...
Posted 08 July 2012 - 07:29 AM
ah ok, so you could input as many colours as you liked and see the output, cool