UI Bug Fix Help!

The Problem?

test-Roblox-Studio-2022-04-04-09-49-31
Clicking on the wrong answer will require the user to click on the Try-Again button.

Additionally, they can also just re-click the No button and the Yes button, and this does not affect the game at all, but it just appears to be a bug.

In other words, I want the Yes and No buttons to be disabled when the Try-Again button is visible.

local function Option_Answer(Answer)
	
	local Submit = game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"].Submit
	local Yes_Button = game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["Yes button"]
	local No_Button = game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["No button"]
	
	Yes_Button.MouseButton1Click:Connect(function()
		Yes_Button.BackgroundColor3 = Color3.fromRGB(244, 248, 0)
		No_Button.BackgroundColor3 = Color3.fromRGB(138, 138, 138)
	end)
	
	No_Button.MouseButton1Click:Connect(function()
		No_Button.BackgroundColor3 = Color3.fromRGB(244, 248, 0)
		Yes_Button.BackgroundColor3 = Color3.fromRGB(138, 138, 138)
	end)
	
	Submit.MouseButton1Click:Connect(function()	
		
		if Answer.BackgroundColor3 == Color3.fromRGB(244, 248, 0) then
			Yes_Button.BackgroundColor3 = Color3.fromRGB(57, 255, 47)
			game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"].Correct.Visible = true
			game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["Next Button"].Visible = true
		else
			No_Button.BackgroundColor3 = Color3.fromRGB(255, 26, 29)
			game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"].Wrong.Visible = true
			game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["Try-Again Button"].Visible = true
		end
		
	end)
	
	game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["Next Button"].MouseButton1Click:Connect(function()
		game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"].Visible = false
		game.Players.LocalPlayer.PlayerGui.ScreenGui["Completed Screen"].Visible = true
	end)

	game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["Try-Again Button"].MouseButton1Click:Connect(function()
		game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"].Wrong.Visible = false
		game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"].Correct.Visible = false
		game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["No button"].BackgroundColor3 = Color3.fromRGB(138, 138, 138)
		game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["Yes button"].BackgroundColor3 = Color3.fromRGB(138, 138, 138)
		game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["Try-Again Button"].Visible = false
	end)
	
end

Option_Answer(game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["Yes button"])

*Here’s my code for the entire option script. :point_up_2:

Can you suggest anything I should add/edit to accomplish my goal? :thinking:

Set Active to false to prevent it from sinking input (being able to be clicked), and set it to true to let it sink input again.

local function Option_Answer(Answer)
	
	local Submit = game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"].Submit
	local Yes_Button = game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["Yes button"]
	local No_Button = game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["No button"]
	
	Yes_Button.MouseButton1Click:Connect(function()
		Yes_Button.BackgroundColor3 = Color3.fromRGB(244, 248, 0)
		No_Button.BackgroundColor3 = Color3.fromRGB(138, 138, 138)
	end)
	
	No_Button.MouseButton1Click:Connect(function()
		No_Button.BackgroundColor3 = Color3.fromRGB(244, 248, 0)
		Yes_Button.BackgroundColor3 = Color3.fromRGB(138, 138, 138)
	end)
	
	Submit.MouseButton1Click:Connect(function()	
		
		Yes_Button.Active = false --Here is the edit you told me to do...
		No_Button.Active = false --Here is the edit you told me to do...
		
		if Answer.BackgroundColor3 == Color3.fromRGB(244, 248, 0) then
			Yes_Button.BackgroundColor3 = Color3.fromRGB(57, 255, 47)
			game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"].Correct.Visible = true
			game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["Next Button"].Visible = true
		else
			No_Button.BackgroundColor3 = Color3.fromRGB(255, 26, 29)
			game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"].Wrong.Visible = true
			game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["Try-Again Button"].Visible = true
		end
		
	end)
	
	game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["Next Button"].MouseButton1Click:Connect(function()
		game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"].Visible = false
		game.Players.LocalPlayer.PlayerGui.ScreenGui["Completed Screen"].Visible = true
	end)

	game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["Try-Again Button"].MouseButton1Click:Connect(function()
		game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"].Wrong.Visible = false
		game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"].Correct.Visible = false
		game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["No button"].BackgroundColor3 = Color3.fromRGB(138, 138, 138)
		game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["Yes button"].BackgroundColor3 = Color3.fromRGB(138, 138, 138)
		game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["Try-Again Button"].Visible = false
	end)
	
end

Option_Answer(game.Players.LocalPlayer.PlayerGui.ScreenGui["Question 2"]["Yes button"])

It doesn’t seem to be working…