The Problem?
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.