Get enumeration names of all instance types

Is there a way to get all the enumeration items of Instance types?

image

For example to get all enum. items for Font (i.e font styles) we would do :

 for _, fontName in ipairs(Enum.Font:GetEnumItems()) do 
       print(fontName) 
 end

Is it possible? Or would I just have to use an array containing all the string names of possible instances?

1 Like

Unfortunately, I don’t believe there is any native way to get all possible enumerations like that. Your best option would probably be to list them all inside of a ModuleScript containing an array, which can then be required to get the list.

See reply below.

You can find all current enumerations on this page: https://developer.roblox.com/en-us/api-reference/enum

1 Like

You can get a table of all enumeration types using Enum:GetEnums()

3 Likes

@0skarian, there is definitely a way to get all Enums:

 for i, enumItems in ipairs(Enums:GetEnums()) do 

       for i, enumItem in ipairs(enumItems:GetEnumItems()) do

            print(enumItem)

       end

 end

Hope that helps!

2 Likes

yeah but what if you only wanted enumeration items of only instance types, take it this way:

for example to get all values of x where doing Instance.new(x) would be valid

I came to the conclusion that there is no way of doing this, at least yet