Why is my Gui not parented to the plugin widget?

Greetings!
So, I am making a plugin, but when I test it, the gui does not show up.

here is the script:

local Toolbar = plugin:CreateToolbar('World Builder Pluguin')

local FoliageGeneratorButton = Toolbar:CreateButton('Foliage Generator', 'A tool helping you to create custom grass, leaves or generally any foliage you desire', 'rbxassetid://5832364067')

local foliageWidget = plugin:CreateDockWidgetPluginGui(
	'Foliage Creator',
	DockWidgetPluginGuiInfo.new(
	Enum.InitialDockState.Float, 
	false,                       
	true,                       
	340,                         
	350,                         
	340,                         
	350
	)                         
)

foliageWidget.Title = 'Foliage Generator'
foliageWidget.Name = "Foliage Generator"

local Gui = script.ScreenGui:Clone()
Gui.Parent = foliageWidget


FoliageGeneratorButton.Click:connect(function()
	plugin:Activate(true)
	foliageWidget.Enabled = not foliageWidget.Enabled
end)


And here is the gui that needs to be displayed:

![Screenshot 2020-12-03 at 8.56.46 PM|690x308](upload://5D84qyr2faPskl6TER9EPTZ2nK3.png) 
thnx
-Yolo

Boosting this because no one has answered and it’s like 7 hours now… :frowning:

Did you click the button first?

Which button? The button to activate the plugin? If so, yes I did.

How do you know the ScreenGui is not parented?

It might be parented, but I only see white, which isn’t supposed to happen…
Btw, for some reason, the screenshot does not show up, so imma reupload it.

Maybe there’s nothing in the ScreenGui or the ScreenGui itself has Enabled set to false


Here’s the image for people

No, it is enabled. (adding more characters)

thnx, for some reason, when I upload it, it does not show it. That’s weird, but nvm.

I’m confused it looks fine to me

I would rewrite this as:

FoliageGeneratorButton.Click:connect(function()
	plugin:Activate(true)
	foliageWidget.Enabled = foliageWidget.Enabled and false or true; -- If the widget is Enabled then disable it else enable it, same as the ternary a ? b : c 
end)
1 Like

This is what I see:

Because you didn’t close the code block

Tried it, but the same is happening.

Put a semi-colon at the end of
plugin:Activate(true)

Didn’t work either. (more characters)

What is this meant to achieve? That will help us deduce the issue.

So, I want gui in my plugin widget, but when I try to run the plugin, the gui does not show up in the window.

Show me the script with the changes