Help me fix this plugin bug!

Im working my own plugin to make my build progress easier. However, i tried update its ui but output always said “TextButton2 is not a valid member name of iGui”. Can you guy help me?
screenshot:
-workspace:
image
-output:
image

(btw im not good at eng so sorry for some mistake)

Hi!

Try printing iGui.iFrame:GetDescendants() and see if it actually exists. If it does, then use :WaitForChild().

ummmm…
image

That means it doesn’t exist. Either you are destroying it somewhere in your code, or you need to update your plugin version. It’s possible you have a version that doesn’t have the TextLabel2.

but that printed text is updated ver. and it still bug

That means that some code in your plugin is destroying TextButton2. I recommend using the Find All feature (Accessible by going to the View tab) and searching for TextButton2 and checking what script uses it and what destroys it.

I checked and no scripts effect to it

umm i think that bug is not abt script in my plugin
even i delete the TextButton (it’s not TextButton2), it still working without error any bug abt it

my script:

local toolbar = plugin:CreateToolbar("test")
local selection = game:GetService("Selection")

local property = {
	["copyColor"] = false,
}

local pluginButton = toolbar:CreateButton(
	"Replacer", --Text that will appear below button
	"e", --Text that will appear if you hover your mouse on button
	"rbxassetid://1") --Button icon

local CoreGui = game:GetService("CoreGui") --Getting CoreGui
local gui = CoreGui:FindFirstChild("iGui") or script.Parent.iGui
gui.Enabled = false --Making gui invisible
gui.Parent = CoreGui --Parenting gui to coregui

local function copy(first, v)
	if not v:IsA("SpawnLocation") then
		if CoreGui:WaitForChild("iGui").iFrame.TextBox.Text == "color" then
			if v.Color ~= first.Color then
				return
			end
		end
		
		if property.copyColor then
			v.Color = first.Color
		end
		v.Transparency = first.Transparency
		v.Color = first.Color
	end
end

pluginButton.Click:Connect(function()
	gui.Enabled = not gui.Enabled --Enabling/Disabling gui after button clicked
end)

gui.iFrame.TextButton.MouseButton1Up:Connect(function()
	local first = nil
	for i, v in pairs(selection:Get()) do
		if i == 1 then
			first = v
		else
			if v:IsA("BasePart") then
				copy(first, v)
			elseif v:IsA("Model") then
				for i2, part in pairs(v:GetDescendants()) do
					if part:IsA("BasePart") then
						copy(first, part)
					end
				end
			end
		end
	end
end)

print(gui.iFrame:GetDescendants())

gui.iFrame.TextButton2.MouseButton1Up:Connect(function()
	property.copyColor = not property.copyColor
end)

Try
print(gui.iFrame:GetDescendants())
at the beginning of the plugin code, and see if it shows there. If it doesn’t, then it’s probably not parented correctly.

oh nvm i fixed it

just reopen the studio and that bug will fix!!

**THIS IS SOLUTION, I CAN’T FIND THE SOLUTION SO I WRITE THIS BY HAND **

That means that you did not update your plugin properly.

Anywho, I suggest marking your post as the solution so others know.