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: enum to string

Previous Thread :: Next Thread 
Fluffy_Husky is not online. Fluffy_Husky
Joined: 23 May 2016
Total Posts: 763
22 Aug 2016 03:11 PM
function enumstring(enum)
return tostring(enum):match("[^%.]+$")
end

now you dont have to keep typing long enums :D
Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
22 Aug 2016 03:12 PM
What the crap is that for. That's completely useless.


-R.B. Box (Regalius Boxikins Box)
Report Abuse
Fluffy_Husky is not online. Fluffy_Husky
Joined: 23 May 2016
Total Posts: 763
22 Aug 2016 03:12 PM
i mean this is only when comparing an enum to a string, to set an enum, you can just put the string or number it corresponds to but this is for stuff like

local mat = enumstring(material)

if mat == "Grass" then

end
Report Abuse
Fluffy_Husky is not online. Fluffy_Husky
Joined: 23 May 2016
Total Posts: 763
22 Aug 2016 03:13 PM
and what is your reply for? it is completely useless as well

dat hypocrite tho
Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
22 Aug 2016 03:13 PM
Still useless IMO.


-R.B. Box (Regalius Boxikins Box)
Report Abuse
Fluffy_Husky is not online. Fluffy_Husky
Joined: 23 May 2016
Total Posts: 763
22 Aug 2016 03:14 PM
you dont have to type Enum.Material.Grass
Report Abuse
Real_Edgy is not online. Real_Edgy
Joined: 23 Oct 2013
Total Posts: 1212
22 Aug 2016 03:14 PM
still useless [2]
Report Abuse
Fluffy_Husky is not online. Fluffy_Husky
Joined: 23 May 2016
Total Posts: 763
22 Aug 2016 03:14 PM
and you also dont have to be rude

go take your attitude to the ODing forum
Report Abuse
Real_Edgy is not online. Real_Edgy
Joined: 23 Oct 2013
Total Posts: 1212
22 Aug 2016 03:16 PM
this is still incredibly useless considering you'll have to type enumstring(...) for every value you want to define
Report Abuse
Fluffy_Husky is not online. Fluffy_Husky
Joined: 23 May 2016
Total Posts: 763
22 Aug 2016 03:17 PM
then just name it es

es(SomeEnum)

then you only have to type the last string like "Grass" or "Keyboard" or "KeyCode"
Report Abuse
Fluffy_Husky is not online. Fluffy_Husky
Joined: 23 May 2016
Total Posts: 763
22 Aug 2016 03:17 PM
^ for keycode I meant "E" and etc

Idk I just got bored and started messing around with match()

at least no noob can do this
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
22 Aug 2016 03:18 PM
That's great, except...

function enumstring(enum) -> enum.Name

It's redundant.
Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
22 Aug 2016 03:19 PM
@Fluffy

I could literally just make a function to iterate through all enum's and insert all of there members into getfenv(), so yea, any noob (including me) could do this.


-R.B. Box (Regalius Boxikins Box)
Report Abuse
Real_Edgy is not online. Real_Edgy
Joined: 23 Oct 2013
Total Posts: 1212
22 Aug 2016 03:19 PM
actually any simpleton with an understanding of character classes could

it's just not practical, i.e., some of us like to see what we're comparing in-line
Report Abuse
Fluffy_Husky is not online. Fluffy_Husky
Joined: 23 May 2016
Total Posts: 763
22 Aug 2016 03:19 PM
^ you dont classify as a noob
i am talking about the beginner scripters who dont even know how to use events which is quite sad
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
22 Aug 2016 03:20 PM
print(workspace.Baseplate.Material.Name)
>Plastic


Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
22 Aug 2016 03:21 PM
damnit lunate u ninja dragon


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