• How to "target" RGB values in Color()
    4 replies, posted
So say I wanted to just get the R value in a Color table and store it in a variable, but not the G, and B values. Does anyone know of a way to do this? Thanks.
[lua]local r = color.r[/lua]
[code] local col = Color local R = 0 function Color(r,g,b,a) R = r return col(r,g,b,a) end Color(100,0,0) [/code]
[QUOTE=Kevlon;50851520][code] local col = Color local R = 0 function Color(r,g,b,a) R = r return col(r,g,b,a) end Color(100,0,0) [/code][/QUOTE] I'm sorry but I'm still rather new to Lua, could you explain this a little bit or elaborate?
[QUOTE=Thane;50851709]I'm sorry but I'm still rather new to Lua, could you explain this a little bit or elaborate?[/QUOTE] The first reply is probably what you're looking for, the second is detouring the Color function so every time it gets called it sets the `R` variable.
Sorry, you need to Log In to post a reply to this thread.