Text buttons not working

For some reasons these text buttons arent registering anything. Here is my code(in a local script)

for i, v in pairs(game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("UIMain"):WaitForChild("Paint"):GetChildren()) do
	if v:IsA("TextButton") then
		if v.Name == "" then
			v.MouseButton1Click:Connect(function()
				selectedcolor = v.BackgroundColor3
				mode = "Paint"
			end)
		end
	end
end

its just not registering the text buttons and image buttons being clicked

Are you sure the buttons are called β€œβ€?

1 Like

maybe its not working because:

you made the script check if the button doesn’t have a name, so try typing somthing inside those " "

instead you can try:

for i, v in pairs(game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("UIMain"):WaitForChild("Paint"):GetChildren()) do
	if v:IsA("TextButton") then
		v.MouseButton1Click:Connect(function()
			selectedcolor = v.BackgroundColor3
			mode = "Paint"
		end)
	end
end

nevermind i fixed it and yes the buttons were all named β€œβ€