Here is a very simple plugin, I am attempting to deactivate not disable the plugin button inside the PluginToolbarButton.Click() event, however it is not working, instead nothing is disabled.
local toolbar : PluginToolbar = plugin:CreateToolbar("awef")
local firstButton : PluginToolbarButton = toolbar:CreateButton("hello","","","hello")
local secondButton : PluginToolbarButton = toolbar:CreateButton("second","","","second")
local widgetInfo = DockWidgetPluginGuiInfo.new(
Enum.InitialDockState.Float,
false,
false,
300,
228,
300,
228
)
local widget
firstButton.Click:Connect(function()
widget = plugin:CreateDockWidgetPluginGui("titleawed",widgetInfo)
widget.Title = "This is the real title"
widget.Enabled = true
widget:BindToClose(function()
firstButton:SetActive(false)
end)
end)
The issue is not so much about the Event itself, the issue comes from the firstButton:SetActive(false) instead of deactivating the firstButton nothing actually happens. I did try your solution out of curiosity, but no luck.
ye, except I’m trying to make it disable when you press the X button on the widget
I have actually tried it outside of the .Click() in a bind to close and it’s still not deactivating it, it’s quite weird, I’ll try doing it with property changed as well