The current thread cannot access '....' (lacking capability Plugin)

first of all yes, i do some searching and found these post:

but, it doesnt seem to solve my problem at all.

my problem is, i keep getting this error:
Screenshot 2023-12-29 173929
Screenshot 2023-12-29 174710
when trying to set a Frame Parent to plugin widget

The script is:

local UI = plugin:CreateDockWidgetPluginGui(
	'System Visualizer',
	DockWidgetPluginGuiInfo.new(
		Enum.InitialDockState.Top,
		true,
		true,
		500,
		100,
		workspace.Camera.ViewportSize.X,
		workspace.Camera.ViewportSize.Y
	)
)

local function refresh()
	local GetSelection: {Instance} = Selection:Get()
	if #GetSelection > 0 and #GetSelection < 2 then
		if GetSelection[1]:IsA('ModuleScript') then
			Module = require(GetSelection[1])
		else
			warn('[Client]: Must Be A ModuleScript')
		end
	end
	if not Module then return end
	if LastFrame then
		LastFrame:Destroy()
		LastFrame = nil
	end
	local Frame = Module.Init() -- It will return a frame from my module script
	if not Frame then
		warn('[Client]: Must Return An Instance From ModuleScript')
	else
		Frame.Parent = UI -- The eror occur here, when i try to set the frame parent to plugin widget
		LastFrame = Frame
	end
end

RefreshBtn.MouseButton1Click:Connect(refresh) -- Image button

i hope it will make some sense :slight_smile: any help is appreciated

1 Like

Nvm, you can just go publish your plugin instead of use as local plugin

(it still seems to error :confused:)

1 Like