How I made plugin inside my roblox game. (EZStudio Lite)

Hello guys,

Today i will show you how I made a custom user-generated plugin system for your game, with vLua…

First, make a setup, your lua interpeter, a module script, and custom “dock” gui template.

The UI instance hierarchy needs to be like this:


You must make the container (for my case it is container)

Second, make a simple function inside the module script, like:

local gui = path.to.gui
local plr = game.Players.LocalPlayer

return function()
local gui = gui:Clone() --// clones the "dock" gui
gui.Parent = plr.PlayerGui
return gui.container --// change "container" based on your "dock" gui.
end

Third, in the interpeter (vLua), add the module as an global, for example:

{
..., Plugin = require(path.to.module),...
}

Lastly, run the code inside the custom interpeter.

local interpeter = require(path.to.interpeter)

task.spawn(function()
interpeter([[

local newPlugin = Plugin()

-- add smth into the GUI
local textLbl = Instance.new("TextLabel", newPlugin) 
-- since the "global" returned an Instance, u can parent it into the gui
textLbl.Text = "hello world"
textLbl.Size = UDim2.new(1,0,1,0) 
]])()

end)

and you should see something like:

For user-generated system, make a custom IDE, make a new ModuleScript. inside, add StringValue, or attribute.

The module script will become the “plugin script” of the user-generated code (a.k.a the StringValue or the attr.) from the IDE.

After that, make plugins folder, and the “plugin script” (a.k.a the module) will be stored there, and add a custom system that load the user-generated code inside the loader, like

for _, plugin in pluginFolder:GetChildren() do
task.spawn(function()

interpeter(require(plugin))()


end)
end