[ API Service ]
A Utility ModuleScript for Roblox API Methods
In short, this is a utility module that includes easy methods for referencing class data via an API dump.
The current main methods include the following:
RobloxAPI: Returns table of Roblox’s API dump.
GetProperties(<Instance>, <boolean> writableOnly): Returns readable properties. ([Name]=Value)
(Returns writable-only properties if second argument is true. Default is false.)
GetProperties(<string> ClassName, <boolean> writableOnly): Returns readable properties. (Name only)
(Returns writable-only properties if second argument is true. Default is false.)
GetFunctions(<Instance>): Returns readable functions. ([Name]=Value)
GetEvents(<Instance>): Returns readable events. ([Name]=Value)
GetClassIcon(<Instance>/<string> ClassName): Returns Icon data for class. Result is the same as StudioService:GetClassIcon().
GetRawClassData(<string> ClassName): Returns class data for given ClassName from the API dump.
GetRawSuperclassMembers(<string> ClassName): Returns all superclass members for given ClassName from the API dump.
GetRawSuperclassProperties(<string> ClassName): Returns all superclass properties for given ClassName from the API dump.
JSONEncodeValue(<DataType/Property>): Encodes value for use in JSONEncoding.
JSONDecodeValue(<DataType/Property>): Decodes encoded value from JSON string format. Only compatible with interal “JSONEncodeValue”.
Serialize(<Instance>, <boolean> getDescendants, <boolean> ignoreScripts): Serializes an instance (and descendants if enabled) into a string format.
(If second argument is true, descendants of the instance will also be serialized. Default is true.)
(If third argument is true, script source code will be ignored. Default is false.)
Deserialize(<Instance>): Returns deserialized instance (and descendants if any). Only compatible with interal serialization.
PrintVersion(<void>): Prints all version information in “Output”.
DeveloperVersion: Version number of release.
DumpVersion: Version of API dump. (Not the version of Roblox API)
LuaVersion: Returns Lua version used at time of version release.
CreatorId: Returns the UserId of “API Service” (ModuleScript) developer.
PrintCredits(<void>): Prints credits in “Output”.
Test(<void>): Returns “true” if base and required ModuleScripts have been required correctly.
Constructors: Table of basic constructors. (Mainly used for internal operations.)
Attributes of APIService:
IgnoreUpdates: If true, update warnings will no longer appear in the output.
Example:
local API = require(7995685995) -- Or replace with path to module
local properties = API:GetProperties(workspace:WaitForChild('SpawnLocation'))
for name,value in pairs(properties) do
print(name,value)
end
Output:
{
["AllowTeamChangeOnTouch"] = false,
["Anchored"] = true,
["Archivable"] = true,
["AssemblyAngularVelocity"] = 0, 0, 0,
["AssemblyCenterOfMass"] = -5.96046448e-08, 0.25, -1.1920929e-07,
["AssemblyLinearVelocity"] = 0, 0, 0,
["AssemblyMass"] = inf,
["AssemblyRootPart"] = SpawnLocation,
["BackParamA"] = -0.5,
["BackParamB"] = 0.5,
["BackSurface"] = Smooth,
["BackSurfaceInput"] = NoInput,
["BottomParamA"] = -0.5,
["BottomParamB"] = 0.5,
["BottomSurface"] = Smooth,
["BottomSurfaceInput"] = NoInput,
["BrickColor"] = Medium stone grey,
["CFrame"] = -5.96046448e-08, 0.25, -1.1920929e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1,
["CanCollide"] = true,
["CanQuery"] = true,
["CanTouch"] = true,
["CastShadow"] = true,
["CenterOfMass"] = 0, 0, 0,
["ClassName"] = "SpawnLocation",
["CollisionGroupId"] = 0,
["Color"] = 0.639216, 0.635294, 0.647059,
["Duration"] = 0,
["Elasticity"] = 0.5,
["Enabled"] = true,
["FormFactor"] = Brick,
["Friction"] = 0.300000011920929,
["FrontParamA"] = -0.5,
["FrontParamB"] = 0.5,
["FrontSurface"] = Smooth,
["FrontSurfaceInput"] = NoInput,
["LeftParamA"] = -0.5,
["LeftParamB"] = 0.5,
["LeftSurface"] = Smooth,
["LeftSurfaceInput"] = NoInput,
["LocalTransparencyModifier"] = 0,
["Locked"] = false,
["Mass"] = 5.599999904632568,
["Massless"] = false,
["Material"] = Plastic,
["Name"] = "SpawnLocation",
["Neutral"] = true,
["Orientation"] = 0, 0, 0,
["Parent"] = Workspace,
["PivotOffset"] = 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1,
["Position"] = -5.96046448e-08, 0.25, -1.1920929e-07,
["ReceiveAge"] = 0,
["Reflectance"] = 0,
["ResizeIncrement"] = 1,
["ResizeableFaces"] = Right, Top, Back, Left, Bottom, Front,
["RightParamA"] = -0.5,
["RightParamB"] = 0.5,
["RightSurface"] = Smooth,
["RightSurfaceInput"] = NoInput,
["RootPriority"] = 0,
["RotVelocity"] = 0, 0, 0,
["Rotation"] = 0, 0, 0,
["Shape"] = Block,
["Size"] = 4, 0.5, 4,
["SpecificGravity"] = 0.699999988079071,
["TeamColor"] = Medium stone grey,
["TopParamA"] = -0.5,
["TopParamB"] = 0.5,
["TopSurface"] = Smooth,
["TopSurfaceInput"] = NoInput,
["Transparency"] = 0,
["Velocity"] = 0, 0, 0,
["archivable"] = true,
["brickColor"] = Medium stone grey,
["className"] = "SpawnLocation",
["formFactor"] = Brick
}
(Technically it would print a bit differently, but this output example looks nicer).
When required, it will automatically make a check to see if it’s up-to-date. However it won’t auto-update.
API Service (272.2 KB) - Model page
This was my first attempt at something like this. Let me know if there are any other features you’d like to see included in this module.
Also credits to this tool for generating the API dump.
Other Resources:
Gif UI Element
Area Sound Kit [v5]
Explorer Info