Skip to content

Script Structure

All scripts must begin with a header to declare things such as name, description, version etc. This header is structured like a jsdoc comment and must be the first thing in the file.

Headers

NameRequired*Plugin Only?Purpose
nameYesNoThe script’s name
descriptionYesNoA description of what the script does
authorYesNoWho made the script
versionNoNoWhat version the script is on, used for updates
downloadUrlNoNoWhere a raw version of the script be found, used for updates
webpageNoNoA webpage where users can get more information about the script.
reloadRequiredNoNoWhether the page needs to reload after a script is installed for it to work. Set to true for always, set to ingame for only when a game is currently active
hasSettingsNoYesWhether a plugin has a settings menu, used to show it does when it’s disabled
needsLibNoYesAny libraries the plugin needs to be enabled to work. Formatted like [Name] | [Url], can be repeated
optionalLibNoYesThe same as needsLib, but the plugin will still work without these and will not try to automatically download them.
isLibraryNo**NoLibraries must include this header so that clueless users don’t accidentally install them as a plugin.
* For legacy reasons these values will simply use a default of "Unknown" if not specified, so they are technically not needed.

** This is required for libraries, not plugins.

Plugin Headers Example

/**
* @name ScriptName
* @description Does something awesome
* @author Joe
* @version 1.5.0
* @downloadUrl https://raw.githubusercontent.com/Joe/GimloaderPlugins/main/plugins/ScriptName/ScriptName.js
* @webpage https://github.com/Joe/GimloaderPlugins/tree/main/plugins/ScriptName/README.md
* @reloadRequired ingame
* @hasSettings true
* @isLibrary false
* @needsLib QuickSettings | https://raw.githubusercontent.com/Gimloader/client-plugins/refs/heads/main/libraries/QuickSettings/build/QuickSettings.js
* @optionalLib CommandLine | https://raw.githubusercontent.com/Blackhole927/gimkitmods/main/libraries/CommandLine/CommandLine.js
*/

Exports

Plugins and libraries can export things using the normal esm syntax. These exported values can then be imported by other plugins and libraries through GL.lib(name) and GL.plugin(name). This is especially helpful for libraries, since they will typically be exporting functions that will be used by other plugins. Exporting something from a library and importing it in a plugin might look something like this:

The library

/**
* @name MyLib
* ...
* @isLibrary true
*/
export function sayHi() {
console.log("Hello from a library!");
}

The plugin

/**
* @needsLib MyLib
*/
const api = new GL();
const myLib = api.lib("MyLib");
myLib.sayHi();

There are also two exports with special meaning- onStop and openSettingsMenu. As the name implies, onStop is called when the user disables the script, and openSettingsMenu is called when the user clicks the button to open a plugin’s setting menu (this does nothing special when used in a library). However, it is discouraged to use these. If possible, use the scoped api’s onStop and openSettingsMenu methods instead.