|
Yes, when reading from a table you can use a metatable with __index to return something else, but I want it for when you read the actual table. For example;
X = {LOL = 5, IDK = 5, IDC = 10}
print(X) --> 500
print(X.LOL) --> 5 |
|
|
Anybody? I would love for a good answer to this... |
|
|
|
It's lovely when you actually get help.. |
|
|
|
|
|
I need it return a Color3.
Should have mentioned that. |
|
|
|
When I first starting asking/answering questions on SH, it was so much more helpful. That wasn't to long ago actually. Now it takes multiple bumps to get an answer. What happened? |
|
|
You
Obviously
Lack
Originality |
|
LacrymaJoin Date: 2010-02-15 Post Count: 22696 |
HELLO WORLD!!!
hi war xdddd |
|
|
Well, erm, hi duel..?
Would you like to, err, help? |
|
LacrymaJoin Date: 2010-02-15 Post Count: 22696 |
You say you want it to return a Color3 value, but will the element stored in the table be a color3? |
|
|
Duel, here's a little bit of background information on the script. Basically I'm creating (you're gonna say it's a waste of time) Color4
Basically it adds a color onto the regular Color3 (Yellow)
Here's the script so far;
Color4 = {
new = function(r, g, b, y)
local r = r or 0
local g = g or 0
local b = b or 0
local y = y or 0
return Color3.new(r + y / 2, g + y/2, b) or Color3.new(r, g, b)
end
}
return Color4
It's a ModuleScript. Anyway, it works well and fine, but if you try to get the properties of r, or g, they will be incorrect. If you try to get y it will be nil, blue however is fine. I need to add in the properties, so first solution that I thought of was to make it return a table of properties, that when read itself returns a Color3.
Help? |
|
|
LacrymaJoin Date: 2010-02-15 Post Count: 22696 |
"Color4"
LOL
pointless |
|
|
Knew you'd say that.
Anybody got a serious answer? |
|
LacrymaJoin Date: 2010-02-15 Post Count: 22696 |
COLOR4 ZOMG LOL |
|
|
I knew it was just a matter of time 'till he started trolling. |
|
|