un1ND3X
(un1ND3X)
May 3, 2020, 2:04pm
#1
Is there a way to get all the enumeration items of Instance types?
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
0skarian
(0skarian)
May 3, 2020, 2:15pm
#2
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
Kacper
(Kacper)
May 3, 2020, 2:18pm
#3
You can get a table of all enumeration types using Enum:GetEnums()
https://developer.roblox.com/en-us/api-reference/datatype/Enums
3 Likes
@0skarian , there is definitely a way to get all Enums:
https://developer.roblox.com/en-us/api-reference/datatype/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
un1ND3X
(un1ND3X)
May 3, 2020, 2:24pm
#5
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
un1ND3X
(un1ND3X)
May 8, 2020, 10:25am
#6
I came to the conclusion that there is no way of doing this, at least yet