badfitz67
|
  |
| Joined: 03 Jun 2010 |
| Total Posts: 13165 |
|
|
| 24 Mar 2017 11:58 AM |
would be doing this: local entity = {__index=entity}
be the same as: local entity = {} entity.__index=entity
mm mm mm, you gotta love that cornflakes's tastelessness |
|
|
| Report Abuse |
|
|
|
| 24 Mar 2017 11:59 AM |
If you're trying to get the value to reference the table it's in, the first one won't work at all.
You could do this though:
local entity entity = {__index = entity} |
|
|
| Report Abuse |
|
|
badfitz67
|
  |
| Joined: 03 Jun 2010 |
| Total Posts: 13165 |
|
|
| 24 Mar 2017 12:00 PM |
kk
mm mm mm, you gotta love that cornflakes's tastelessness |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 24 Mar 2017 12:20 PM |
"local entity entity = {__index = entity}"
If you want the __index field to be nil. |
|
|
| Report Abuse |
|
|
|
| 24 Mar 2017 12:26 PM |
| Oops, I can't believe I just did that. I was thinking of something else |
|
|
| Report Abuse |
|
|
JoshRBX
|
  |
| Joined: 19 May 2012 |
| Total Posts: 8778 |
|
|
| 24 Mar 2017 12:39 PM |
All methods will either set entity.___index to nil or just error.
|
|
|
| Report Abuse |
|
|
|
| 24 Mar 2017 12:44 PM |
> All methods will either set entity.___index to nil or just error.
No, the OP's second one would work |
|
|
| Report Abuse |
|
|
JoshRBX
|
  |
| Joined: 19 May 2012 |
| Total Posts: 8778 |
|
|
| 24 Mar 2017 01:16 PM |
Oh yeah, I was just thinking that it will return nil because the table is empty. It actually returned this upon testing...
> table: 0x80635c90
|
|
|
| Report Abuse |
|
|