Every Asset type in table form

So Roblox have something called AssetType and it has all the assets in number form so I converted it into name form! Check the table below for the code

Table
local ConversionTable = {
	[1] = "Image",
	[2] = "T-Shirt",
	[3] = "Audio",
	[4] = "Mesh",
	[5] = "Script",
	[8] = "Hat",
	[9] = "Place",
	[10] = "Model",
	[11] = "Shirt",
	[12] = "Pants",
	[13] = "Decal",
	[17] = "Head",
	[18] = "Face",
	[19] = "Gear",
	[21] = "Badge",
	[24] = "Animation",
	[27] = "Torso",
	[28] = "Right Arm",
	[29] = "Left Arm",
	[30] = "Left Leg",
	[31] = "Right Leg",
	[32] = "Package",
	[34] = "Gamepass",
	[38] = "Plugin",
	[40] = "Meshpart",
	[41] = "Hair Accessory",
	[42] = "Face Accessory",
	[43] = "Neck Accessory",
	[44] = "Shoulder Accessory",
	[45] = "Front Accessory",
	[46] = "Back Accessory",
	[47] = "Waist Accessory",
	[61] = "Emote Animation",
	[62] = "Video",
}

This can be used if your making something that includes getting the asset type and displaying it! I hope it is useful because it took me a while to make it :I

  • Useful
  • Not Useful

0 voters

1 Like

No point in this when you can automate it with code so that if any new enums are added then your table will also contain them. Additionally, the chances you’ll need to do this over directly referencing only the enums you need for your current system are slim. Usually the exception cases are for working with avatar customisation when needing to sort types.

local assetTypes do
    local assetTypeEnums = Enum.AssetType:GetEnumItems()

    assetTypes = table.create(#assetTypeEnums)

    for _, enumItem in ipairs(assetTypeEnums) do
        table.insert(assetTypes, enumItem.Name)
    end
end

print(assetTypes)

Not to mention that your table has wrong names (accessory types do not have a space in their name) and missing values (47-62 among others), creating an array with gaps. The above will provide a gapless array.

8 Likes

wait
WHAT THAT IS POSSIBLE??? wow man just wow

1 Like

I really appreciate people like you who try to contribute things enthusiastically. Of course there is always the risk of unknown alternative solutions, but don’t stop contributing.

this dosent work tbh so yea i wont use it now

?

“It doesn’t work” doesn’t tell me anything. Details on how you deployed this code and found it “not to work” please. That means modifications, existing code where this was placed, errors and the like.

2 Likes

it just prints but i cant use it

That sounds like a problem with the way you’re trying to integrate this in your code. Feel free to PM me or create a thread in Scripting Support to resolve issues and include relevant details so you can be helped. I don’t want to further derail this thread into focusing on my alternative suggestion.

2 Likes

I know I’m kinda late but this is pretty useful I’d say, if you have a preloading system you can preload every type of asset. Even scripts!