Why's the plugin window bugged?

Here’s an image:


code:

local pluginbar = plugin:CreateToolbar("Malwarebytes knockoff")
local pluginbutton = pluginbar:CreateButton("Scan the game", "Scans the game, searched for suspicious names. (no script reading support)", "rbxassetid://10605442070")
local windowinfo = DockWidgetPluginGuiInfo.new(
	Enum.InitialDockState.Bottom,
	false,
	false
)
local window = plugin:CreateDockWidgetPluginGui(
	"Scanning options", windowinfo
	
)
local test = Instance.new("Frame", window)
local windowopened = false
pluginbutton.Click:Connect(function()
	if not windowopened then
		
		window.Enabled = true 
			windowopened = true
			
	else
		window.Enabled = false
		windowopened = false
		end
end)

i’ve got no clue. it’s a wip. i’m creating an antivirus.

What is wrong with it that makes you think it is bugged?

have you seen the image? it’s not docked and the window doesn’t have a name. the frame doesn’t even appear

Then dock it? I don’t think Roblox widgets get auto docked (or at least whenever I refresh my plugins they don’t dock nicely).

You need to set the title of the widget. That is an issue with your code. Below is an example I found on a YT vid:

Don’t you need to set the parent of the frame to the widget? (view the code I already put above which shows you how).

image
image
image

Sorry what? I don’t understand how the image you have sent effects anything?

initialdockingstate is bottom, it’s not docked, i clearly set the name like in the picture you sent and i game instance.new parameters to know where to automatically parent the frame.

Can you send a whole picture of the screen?

didn’t undock


the black part is the gui i’m working on

Um that looks strange… It looks like it may be a bug.

You could try resetting your studio and seeing if that changes anything.

i uploaded it yesterday. should’ve worked. i have no clue. i even added a screengui for god’s sake!

Looks like you fixed the title yourself. In your original post, there is no title in the code snippet or on the widget, but in later replies, the title is there. I assume that’s working now.

As for the frame, it’s there. The default size when you create a frame is 0 by 0 pixels. You have to manually resize the frame in order to visually see it.

I used your exact code and just added a title and resized the frame. This is what I got:

The code:

local pluginbar = plugin:CreateToolbar("Malwarebytes knockoff")
local pluginbutton = pluginbar:CreateButton("Scan the game", "Scans the game, searched for suspicious names. (no script reading support)", "rbxassetid://10605442070")
local windowinfo = DockWidgetPluginGuiInfo.new(
	Enum.InitialDockState.Bottom,
	false,
	false
)
local window = plugin:CreateDockWidgetPluginGui(
	"Scanning options", windowinfo

)
window.Title = "hello"
local test = Instance.new("Frame", window)
test.Size = UDim2.new(0, 100, 0, 100)

local windowopened = false
pluginbutton.Click:Connect(function()
	if not windowopened then

		window.Enabled = true 
		windowopened = true

	else
		window.Enabled = false
		windowopened = false
	end
end)

i didn’t fix it, i’ll try this. thank you!

only problem is that it’s not docked.

The InitialDockstate only refers to the very first time you use the widget. For example, if you set the InitialDockstate to Bottom, and while testing the plugin, you manually move the widget (with your mouse) to a floating state, the dockstate and position are saved. This means that the next time you open up the plugin, the dockstate and position will be the same as you left them in, rather than set to the InitialDockstate value. In our example, this would mean that the widget would be floating and in the position we last left it in. This is by design of the InitialDockstate property. To fix this, you can simply manually dock the widget back into the bottom panel. It should stay there until you change it again.

Have the other 2 original issues (title and frame) been resolved?

2 Likes

thank you so much. but could you help with one last thing? For testing purposes, i want the script to print out the ancestors of the virus so the player knows where the script is (incase they have safe and virus scripts with the same name)

I don’t know if I would be able to help you with that. You’d need to give me more detail. I suggest you put it in a new topic so others can have a chance to help you out. If you do make a topic, I’ll see if I can help out.

1 Like

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