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:

