Is there a way that I can find a List of ClassNames? I need it for a Module that I am creating.
4 Likes
There is the Class Index page on the Developer Hub if that is the kind of thing you are talking about.
Otherwise if you are talking about retrieving them in a table from a script then Iām not so sure how.
8 Likes
You could find all the class names using HttpService
local HttpService = game:GetService("HttpService")
local URL= "https://pastebin.com" .. "/raw/sxNsDjNm"
-- :GetASync gets the data from the website, in this case the function would be returning a string, so we need to convert it into a table
local stringList = HttpService:GetAsync(URL)
local classes = stringList:split("\n")
-- :split returns a table of characters that are in between the 1st parameter, since there's a space in between in class on the post, we use \n to refer to that space
7 Likes
You could use the Roblox API to get an up-to-date list of ClassNames.
-- I replaced setup.roblox.com to s3.amazonaws.com/setup.roblox.com
local HttpService = game:GetService("HttpService")
local studioVersion = HttpService:GetAsync("https://s3.amazonaws.com/setup.roblox.com/versionQTStudio")
-- Get latest studio version using GetAsync
local Dump = HttpService:GetAsync("https://s3.amazonaws.com/setup.roblox.com/"..studioVersion.."-API-Dump.json")
-- Get API Dump
local Data = HttpService:JSONDecode(Dump)
-- Convert JSON to lua table
local Classes = {} -- table
for _,v in pairs(Data.Classes) do
table.insert(Classes,(#Classes + 1),v.Name) -- Insert ClassName to table
print(v.Name) -- Print ClassName
end
3 Likes
Thanks! I needed a list of all movement constraints, which are now hidden from the instance create menu.