|
| 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 |
|
|
|
| 22 Aug 2016 03:12 PM |
What the crap is that for. That's completely useless.
-R.B. Box (Regalius Boxikins Box) |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 22 Aug 2016 03:13 PM |
and what is your reply for? it is completely useless as well
dat hypocrite tho |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2016 03:13 PM |
Still useless IMO.
-R.B. Box (Regalius Boxikins Box) |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2016 03:14 PM |
| you dont have to type Enum.Material.Grass |
|
|
| Report Abuse |
|
|
Real_Edgy
|
  |
| Joined: 23 Oct 2013 |
| Total Posts: 1212 |
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 22 Aug 2016 03:20 PM |
print(workspace.Baseplate.Material.Name) >Plastic
|
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 22 Aug 2016 03:21 PM |
damnit lunate u ninja dragon
|
|
|
| Report Abuse |
|
|