Advertisement
Vaeb

Instance API Documentation

Aug 2nd, 2016
479
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.29 KB | None | 0 0
  1. --[[
  2.  
  3. -> API
  4.     -> API.hasLoaded [Property]
  5.         -> Checks if the API has loaded
  6.  
  7.     -> API:wait() [Method]
  8.         -> Waits for the API to load (Async)
  9.    
  10.     -> API:GetProperties(Obj, checkAncestors, includeLocked) [Method]
  11.         -> Returns the properties of an Instance OR ClassName
  12.             -> Parameters
  13.                 -> Obj [Instance OR string]
  14.                     -> The Instance or ClassName for which properties will be returned (Either type can be used)
  15.                 -> checkAncestors [bool]
  16.                     -> Default
  17.                         -> true
  18.                     -> Values
  19.                         -> true
  20.                             -> Properties inherited from other classes (e.g. BasePart properties inherited by Part) will be included
  21.                         -> false
  22.                             -> Properties inherited from other classes will not be included
  23.                 -> includeLocked [bool]
  24.                     -> Default
  25.                         -> true
  26.                     -> Values
  27.                         -> true
  28.                             -> Properties with a security context tag (E.g. RobloxLocked) will be included
  29.                         -> false
  30.                             -> Properties with a security context tag will not be included
  31.             -> Returns
  32.                 -> [Array <string>]
  33.                     -> Each property's name will be stored in the return Array as a string
  34.         -> Example
  35.             -> Code
  36.                 -> print(table.concat(API:GetProperties("Part"), ", "))
  37.             -> Output
  38.                 -> Shape, FormFactor, Anchored, BackParamA, BackParamB, BackSurface, BackSurfaceInput,
  39.                 -> BottomParamA, BottomParamB, BottomSurface, BottomSurfaceInput, BrickColor, CanCollide,
  40.                 -> CustomPhysicalProperties, Elasticity, Friction, FrontParamA, FrontParamB, FrontSurface,
  41.                 -> FrontSurfaceInput, LeftParamA, LeftParamB, LeftSurface, LeftSurfaceInput, Locked,
  42.                 -> Material, ReceiveAge, Reflectance, ResizeIncrement, ResizeableFaces, RightParamA,
  43.                 -> RightParamB, RightSurface, RightSurfaceInput, RotVelocity, SpecificGravity, TopParamA,
  44.                 -> TopParamB, TopSurface, TopSurfaceInput, Archivable, ClassName, DataCost, Name, Parent,
  45.                 -> RobloxLocked
  46.  
  47.     -> API:GetPropertiesData(Obj, checkAncestors, includeLocked) [Method]
  48.         -> Returns data about the properties of an Instance OR ClassName (Property name, value type, security context, etc.)
  49.             -> Parameters
  50.                 -> Duplicate of parameters for API:GetProperties()
  51.             -> Returns
  52.                 -> [Array <Dictionary>]
  53.                     -> Each property's information will be stored in the return Array as a Dictionary in the following structure:
  54.                         -> {
  55.                             Name = Property name [string],
  56.                             Type = Property value type [string],
  57.                             Class = ClassName the property is directly inherited from [string],
  58.                             Deprecated = Is the property deprecated [bool],
  59.                             ReadOnly = Is the property read only [bool],
  60.                             Security = Security context needed to access this property [string]
  61.                         }
  62.         -> Example
  63.             -> Code
  64.                 -> local LockedProp = API:GetPropertiesData("DataModel").RobloxLocked
  65.                 -> print("Property Name: " .. LockedProp.Name .. ", Property Class: " .. LockedProp.Class .. ",
  66.                 -> Property Security: " .. LockedProp.Security .. ", Property Value Type: " .. LockedProp.Type)
  67.             -> Output
  68.                 -> Property Name: RobloxLocked, Property Class: Instance, Property Security: PluginSecurity, Property Value Type: bool
  69.    
  70.     -> API:GetMethods(Obj, checkAncestors, includeLocked) [Method]
  71.         -> Duplicate of API:GetProperties() however it returns methods instead of properties
  72.  
  73.     -> API:GetMethodsData(Obj, checkAncestors, includeLocked) [Method]
  74.         -> Duplicate of API:GetPropertiesData() however it returns method data instead of property data
  75.  
  76.     -> API:GetEvents(Obj, checkAncestors, includeLocked) [Method]
  77.         -> Duplicate of API:GetProperties() however it returns events instead of properties
  78.  
  79.     -> API:GetEventsData(Obj, checkAncestors, includeLocked) [Method]
  80.         -> Duplicate of API:GetPropertiesData() however it returns event data instead of property data
  81.  
  82.     -> API:GetAncestors(Obj) [Method]
  83.         -> Returns the ancestors of an Instance OR ClassName
  84.             -> Parameters
  85.                 -> Obj [Instance OR string]
  86.                     -> The Instance or ClassName for which ancestors will be returned (Either type can be used)
  87.             -> Returns
  88.                 -> [Array <string>]
  89.                     -> Returns Array of ancestor ClassNames
  90.         -> Example
  91.             -> Code
  92.                 -> print(table.concat(API:GetAncestors("Part"), ", "))
  93.             -> Output
  94.                 -> FormFactorPart, BasePart, PVInstance, Instance, <<<ROOT>>>
  95.  
  96. ]]
  97.  
  98.  
  99. --EXAMPLE USAGE--
  100.  
  101. local API = require(470628228)
  102. API:wait()
  103.  
  104. print("\n\n-------------------------------------------------------------")
  105. print("PROPERTIES")
  106. print("-------------------------------------------------------------\n")
  107.  
  108. print("[PART]", table.concat(API:GetProperties("Part"), ", ") .. "\n")
  109. print("[PART SPECIFIC]", table.concat(API:GetProperties(Instance.new("Part"), false), ", ") .. "\n")
  110. print("[DATAMODEL UNLOCKED]", table.concat(API:GetProperties("DataModel", true, false), ", ") .. "\n")
  111. local LockedProp = API:GetPropertiesData("DataModel").RobloxLocked
  112. print("[DATAMODEL] [ROBLOXLOCKED]", "Property Name: " .. LockedProp.Name .. ", Property Class: " .. LockedProp.Class .. ", Property Security: " .. LockedProp.Security .. ", Property Value Type: " .. LockedProp.Type .. "\n")
  113.  
  114. print("-------------------------------------------------------------")
  115. print("METHODS")
  116. print("-------------------------------------------------------------" .. "\n")
  117.  
  118. print("[WORKSPACE]", table.concat(API:GetMethods("workspace"), ", ") .. "\n")
  119. print("[PLAYER SPECIFIC]", table.concat(API:GetMethods("Player", false), ", ") .. "\n")
  120. local ObjMethod = API:GetMethodsData("DataModel").Destroy
  121. print("[DATAMODEL] [Destroy]", "Method Name: " .. ObjMethod.Name .. ", Method Class: " .. ObjMethod.Class .. ", Method Deprecated: " .. tostring(ObjMethod.Deprecated) .. ", Method ReadOnly: " .. tostring(ObjMethod.ReadOnly) .. "\n")
  122.  
  123. print("-------------------------------------------------------------")
  124. print("EVENTS")
  125. print("-------------------------------------------------------------" .. "\n")
  126.  
  127. print("[GUIOBJECT]", table.concat(API:GetEvents("GuiObject"), ", ") .. "\n")
  128. print("[GUISERVICE]", table.concat(API:GetEvents(game:GetService("GuiService")), ", ") .. "\n")
  129. print("[GUISERVICE UNLOCKED]", table.concat(API:GetEvents(game:GetService("GuiService"), true, false), ", ") .. "\n")
  130.  
  131. print("-------------------------------------------------------------")
  132. print("ANCESTORS")
  133. print("-------------------------------------------------------------" .. "\n")
  134.  
  135. print("[SCRIPT]", table.concat(API:GetAncestors("Script"), ", ") .. "\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement