Using APIs
Types and Autocomplete
Section titled “Types and Autocomplete”To get type-checking and autocomplete for APIs, you should load the API Reference in the SDK plugin.
Using in Scripts
Section titled “Using in Scripts”The public APIs are designed to be easily accessible and usable no matter the context. To use an API, you can import it like so:
local ReplicatedStorage = game:GetService("ReplicatedStorage")local APIName = require(ReplicatedStorage.API.APIName)When you have imported an API, you can then proceed to use it as documented. In general, this is either:
API.FunctionName(params) -- for module APIs-- orAPI(params) -- for function APIsIn the end, you will end up with something like this:
-- At the top of the scriptlocal ReplicatedStorage = game:GetService("ReplicatedStorage")local Combat = require(ReplicatedStorage.API.Combat)
-- ...somewhere else in the scriptCombat.MakeExplosion(explosionParams)