Need some help with my plugin!

Hello, I recently made a plugin but there is two issues I just can’t fix:

1: My Plugin icon will always show up as a red X not the Plugin icon

2: I need to click my plugin 3 times before it will open

How can i fix these things?

Please provide a code sample regarding the 3 times opening, that is unusual behaviour.

Regarding the red X, have you given it enough time for your plugin icon to pass moderation?

Probably the case for question 1

Here is my code:

local wasOpened = {}

local widgetInfo = DockWidgetPluginGuiInfo.new(
	Enum.InitialDockState.Float, -- type
	false, -- enable widget at start
	true, -- just keep it like this
	450,    -- default width
	455,    -- default height
	500,    -- minimum width
	200     -- minimum height
)

local widget = plugin:CreateDockWidgetPluginGui("DataEditorWidget", widgetInfo)
widget.Title = "DataStore Pro"

local gui = script.Parent.Gui.Main:Clone()
gui.Parent = widget

local settingsFrame = script.Parent.Gui.Settings:Clone()
settingsFrame.Parent = widget

local HelpFrame = script.Parent.Gui.Help:Clone()
HelpFrame.Parent = widget

local loadingFrame = script.Parent.Gui.Loading:Clone()
loadingFrame.Parent = widget

btn.Click:Connect(function()
	widget.Enabled = not widget.Enabled
end)

Let me know if you need more

  1. You need to upload it to the account or a group where you own the plugin, otherwise it won’t work

I’m not evercreeper, but I need more

1 Like

function test()
	return game:GetService("RunService"):IsEdit()
end

if pcall(test) then
	print("DataStore Pro is running!")
else
	print("DataEditor can't run during runtime!")
	return
end

local toolbar = plugin:CreateToolbar('DataStore Pro')
local btn = toolbar:CreateButton('Toggle DataStore Pro', 'Toggle DataStore Pro window.', 'rbxassetid://13223763952')
local orderedDS = false
local reverseListing = plugin:GetSetting("revList")

local placeId = game.PlaceId

local recents = plugin:GetSetting(tostring(placeId).."Recents")
if not recents then
	recents = {
		DS = {},
		Keys = {},
	}
end

if reverseListing == nil then
	reverseListing = false
end

local wasOpened = {}

local widgetInfo = DockWidgetPluginGuiInfo.new(
	Enum.InitialDockState.Float, -- type
	false, -- enable widget at start
	true, -- just keep it like this
	450,    -- default width
	455,    -- default height
	500,    -- minimum width
	200     -- minimum height
)

local widget = plugin:CreateDockWidgetPluginGui("DataEditorWidget", widgetInfo)
widget.Title = "DataStore Pro"

local gui = script.Parent.Gui.Main:Clone()
gui.Parent = widget

local settingsFrame = script.Parent.Gui.Settings:Clone()
settingsFrame.Parent = widget

local HelpFrame = script.Parent.Gui.Help:Clone()
HelpFrame.Parent = widget

local loadingFrame = script.Parent.Gui.Loading:Clone()
loadingFrame.Parent = widget

btn.Click:Connect(function()
	widget.Enabled = not widget.Enabled
end)

When I ran the code as a local plugin, the icon failed to load for me as well. The icon must be either a moderated image or a bad ID.

I had to comment out the code below for it to work for me due to not having the GUI.

Code

My current thoughts are:

  • Your plugin does not wait for those assets to be available and just assumes they exist, which means your script is erroring
  • Your computer is just lagging to open the plugin
Some 'fixes' for the code
local function test() -- sorta pointless unless you are going to need to keep checking this
	return game:GetService("RunService"):IsEdit()
end

assert(test, "DataEditor Pro cannot run in on a live server.") -- Bails if the "test" is false
print("DataEditor Pro is running!")

local toolbar = plugin:CreateToolbar('DataStore Pro')
local btn = toolbar:CreateButton('Toggle DataEditor Pro', 'Toggle DataEditor Pro window.', 'get a new id here')
local reverseListing = plugin:GetSetting("revList")

-- Variables

local orderedDS = false
local placeId = game.PlaceId
local wasOpened = {}
local recents = plugin:GetSetting(tostring(placeId).."Recents")

-- Assignment

if not recents then
	recents = {
		DS = {},
		Keys = {},
	}
end

-- the brackets are making it a statement, and a statement returns true or false,
-- so the line below is saying "if reverse listing is not nil, make this true, else make it false"
reverseListing = (reverseListing ~= nil) 


local widgetInfo = DockWidgetPluginGuiInfo.new(
	Enum.InitialDockState.Float, -- type
	false, -- enable widget at start
	true, -- just keep it like this
	450,    -- default width
	455,    -- default height
	500,    -- minimum width
	200     -- minimum height
)

-- Fix below, just in case for some reason the script has loaded but not its parents 🤷‍

local widget = plugin:CreateDockWidgetPluginGui("DataEditorWidget", widgetInfo)
widget.Title = "DataStore Pro"

local gui = script.Parent.Gui.Main:Clone()
gui.Parent = widget

local settingsFrame = script.Parent.Gui.Settings:Clone()
settingsFrame.Parent = widget

local HelpFrame = script.Parent.Gui.Help:Clone()
HelpFrame.Parent = widget

local loadingFrame = script.Parent.Gui.Loading:Clone()
loadingFrame.Parent = widget

-- Connections

btn.Click:Connect(function()
	widget.Enabled = not widget.Enabled
end)

Was a decal ID or image ID used for the plugin? If it was a decal ID, you can use the Imiji (that’s the right name right) plugin or you can insert a GUI textbutton somewhere and paste the ID into them to convert it to an image ID

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.