generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Can I make new Enums?

Previous Thread :: Next Thread 
distalDigitPhalanx is not online. distalDigitPhalanx
Joined: 25 Jan 2015
Total Posts: 1509
21 Oct 2015 03:23 AM
Basically the title. Can I do something like Enum.new(), or whatever?
Report Abuse
chimmihc is not online. 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
AmbientOcclusion is not online. AmbientOcclusion
Joined: 10 Feb 2009
Total Posts: 1323
21 Oct 2015 04:29 AM
enums are read-only

stop trying to add something to roblox without knowing C++ scrubs
Report Abuse
MKofOrbiter is not online. MKofOrbiter
Joined: 28 Aug 2010
Total Posts: 910
21 Oct 2015 04:47 AM
^
Report Abuse
DarthStrantax is not online. DarthStrantax
Joined: 31 May 2011
Total Posts: 2610
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
AmbientOcclusion is not online. AmbientOcclusion
Joined: 10 Feb 2009
Total Posts: 1323
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
MKofOrbiter is not online. MKofOrbiter
Joined: 28 Aug 2010
Total Posts: 910
21 Oct 2015 05:13 AM
^

Exactly.

And if you could what would be the purpose anyways...
Report Abuse
Happywalker is not online. Happywalker
Joined: 05 Mar 2010
Total Posts: 3672
21 Oct 2015 05:24 AM
yes
Enum.Platform.Nintendo5Ds k
Report Abuse
TickerOfTime is not online. TickerOfTime
Joined: 02 Sep 2012
Total Posts: 2030
21 Oct 2015 06:15 AM
local OldEnum = Enum
Local Enum = {}
setmetatable(Enum,{__index=OldEnum})

Done
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
21 Oct 2015 06:53 AM
You guys are stupid.
Report Abuse
TickerOfTime is not online. TickerOfTime
Joined: 02 Sep 2012
Total Posts: 2030
21 Oct 2015 11:16 PM
I didn't say it was good, I just said it was possible
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image