codeCreate Add-ons

Add-ons are custom modules that add functionality to the plugin & game-module

How it works

Any add-on uses this format: CoolAddon is the module that will only run in the plugin. game module will be synced to game-module's add-ons folder CoolAddon will use the ui-library to make ui and should return a table like this:

return {
	api = gameapi, -- require(script.game)
	name = "Screen effects",
	icon = 97990680261359,
	description = [[
		- ImpactFrames (CCE)
		- CameraShake (with presets)
		- Camera weld (VFX on screen)
		ImpactFrames emit others enable
	]],
	uninstall = function()
		-- optional
	end
}

Which will show this in Manage Add-ons:

game module can return anything, and whatever it returns will be put in the API ex: return { customFunc = function() } will be shared.fx.CoolAddon.customFunc() also it will be renamed to CoolAddon when put under ReplicatedStorage.vfx.addons:

The main function game module should use most is THIS:

emit happens with .emit(vfx) and with Emit button in plugin (same for enable and disable) retime, rescale, and recolor happen with module's functions too (AND plugin sliders!!!!!1) so everything here is used in-game (with funcs like .recolor()) and in plugin with Sliders!!

Installation

Add-ons can be installed by clicking the button in Manage Add-ons Or with a shortcut for quick reinstalling when debugging/developing an add-on

Debugging

To easily make, edit, and debug add-ons, they will be placed in ServerStorage.vfx_addons That folder is made and reserved by the plugin to store add-ons in the place (for debugging & more) Errors, warnings, and prints will point to the script in vfx_addons even if the add-on is published Add-ons are automatically uninstalled when they error or take too long to return. When an add-on is uninstalled, all connections and objects it created are cleaned up- except things made independently, which should be cleaned up by the custom uninstall function

Limitations

  1. Add-ons must return in max 2 seconds (this is to make sure the game-module loads fast in-game)

  2. Add-ons can only have classes ModuleScript and Folder (it will support all types of instances soon since roblox released ReflectionServicearrow-up-right)

  3. Add-ons in-game can't be uninstalled like in plugin

circle-info

You can use task.spawn to not yield the main thread if you need more time than 2s

Publishing

Add-ons can be published so anyone with the plugin can install and use them

You can choose to make your add-on open-source where anyone can get the source and edit- by clicking this or choose not to. but the game module will be exposed to be used in games.

You can also make a license/terms that user must agree upon to install your add-on, like this:

This is done using the canInstall callback, which will only allow installing if it returns true It can also be used to make add-ons paid by checking if user owns a gamepass or through http

How to start

Start by reading an open-source add-on as a template, then add your own functionality, or- by reading the ui-library document and learn how to make UI like a properties UI for your add-on

Last updated