|
| 21 Oct 2015 03:23 AM |
| Basically the title. Can I do something like Enum.new(), or whatever? |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 21 Oct 2015 04:25 AM |
| Why would you want that? I see no reason whatsoever that you would need something like that for. |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2015 04:29 AM |
enums are read-only
stop trying to add something to roblox without knowing C++ scrubs |
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Oct 2015 04:54 AM |
Metatables.
local OldEnv={Enum=Enum} local Enum={Hi='Hello'} setmetatable(Enum,{ __index=function(_,a) return OldEnv.Enum[a] end; }) Enum.new=function(a,b) Enum[a]=b end Enum.new('Hai','Hi') print(Enum.Hi) print(Enum.Hai) print(Enum.SurfaceType) |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2015 05:08 AM |
yeah metatables whatever
but seriously Enums are a read-only table you can't modify it with metatables i'm pretty sure of it |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2015 05:13 AM |
^
Exactly.
And if you could what would be the purpose anyways... |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2015 05:24 AM |
yes Enum.Platform.Nintendo5Ds k |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2015 06:15 AM |
local OldEnum = Enum Local Enum = {} setmetatable(Enum,{__index=OldEnum})
Done |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
| |
|
|
| 21 Oct 2015 11:16 PM |
| I didn't say it was good, I just said it was possible |
|
|
| Report Abuse |
|
|