How would I make a GUI to a plugin?

Hey there!

I am really interested in making plugins, so I’m about to make one.
so I’m working on a game Graphic plugin, that will enable all the best graphics, made by me.

so basically, I want a GUI that will be enabled whenever I click the plugin from the toolbar.
and whenever I click Apply it will enable the plugin it self, I don’t really know how to make it so it will duplicate a GUI and make it visible after clicking the plugin from the toolbar, so yeah, support will be appreciated thanks!

I want it to work like this plugin:

script:

local toolbar = plugin:CreateToolbar("Better Graphics")

local newScriptButton = toolbar:CreateButton("Better Graphics", "Adds High graphic quality to your game.", "rbxassetid://4458901886")

newScriptButton.Click:Connect(function()

-- Full script
end)

This is my plugin’s GUI:

4 Likes

You don’t necessarily have to clone the gui, though. You can parent the gui to the CoreGui service. You’d have to make the plugin a folder, put the script in it and put the gui inside the script. Then you can access the ui and parent it to CoreGui:

local ui = script:FindFirstChildOfClass("ScreenGui")
-- or local ui = script:WaitForChild("ScreenGuiName")

ui.Parent = game:GetService("CoreGui")
4 Likes

It’s not working for me, I think I did something wrong, here is the full script.

is there anything wrong i did?

local toolbar = plugin:CreateToolbar("Better Graphics")

local newScriptButton = toolbar:CreateButton("Better Graphics", "Adds High graphic quality to your game.", "rbxassetid://4458901886")

newScriptButton.Click:Connect(function()

local folder = Instance.new("Folder")

local PluginScript = script

PluginScript.Parent = folder

local ui = script:WaitForChild("PluginUI")

ui.Parent = game:GetService("CoreGui")

local Graphics = game:GetService("Lighting")

Graphics.Ambient = Color3.fromRGB(0,0,0)

Graphics.ShadowSoftness = 0

Graphics.EnvironmentDiffuseScale = .2

Graphics.EnvironmentSpecularScale = 1

Graphics.Brightness = 4

Graphics.GlobalShadows = true

Graphics.ExposureCompensation = 0.07

Graphics.ColorShift_Bottom = Color3.fromRGB(0,0,0)

Graphics.ColorShift_Top = Color3.fromRGB(0,0,0)

Graphics.OutdoorAmbient = Color3.fromRGB(99,99,99)

local sky = Instance.new("Sky")

sky.Parent = Graphics

local atmosphere = Instance.new("Atmosphere")

atmosphere.Parent = Graphics

atmosphere.Offset = 1

atmosphere.Density = 0.171

sky.SunAngularSize = 5

sky.MoonAngularSize = 2.35

local sunRays = Instance.new("SunRaysEffect")

sunRays.Intensity = 0.079

sunRays.Spread = 1

sunRays.Parent = Graphics

local bloom = Instance.new("BloomEffect")

bloom.Threshold = 2.138

bloom.Size = 30

bloom.Intensity = 1

bloom.Parent = Graphics

local DepthOfField = Instance.new("DepthOfFieldEffect")

DepthOfField.FarIntensity = 0.149

DepthOfField.FocusDistance = 0

DepthOfField.InFocusRadius = 39.845

DepthOfField.NearIntensity = 0.617

DepthOfField.Parent = Graphics

local ColorCorrection = Instance.new("ColorCorrectionEffect")

ColorCorrection.TintColor = Color3.fromRGB(255,255,255)

ColorCorrection.Saturation = 0

ColorCorrection.Contrast = .1

ColorCorrection.Brightness = .1

ColorCorrection.Parent = Graphics

end)

No, this is what I meant:

image

You insert a folder into ServerScriptService, put the script in the plugin, and the screengui in the script

-- example code
local ui = script:WaitForChild("ScreenGui")
ui.Parent = game:GetService("CoreGui")
8 Likes

yeah I already had that on (30)

Do it all in studio, not in the plugin itself. Right click the folder and publish that as a plugin (either locally or as an actual plugin)

1 Like

thank you it works, do you know how would i make it so if i click a gui button it will work?

Use the MouseButton1Click event for those buttons:

GuiButton.MouseButton1Click:Connect(function()
    print("yo!")
end)

oh, nevermind I encountered a problem and thought that it will only be available outside of studio mode, thank you so much! fixed it