This is the last Part to this Quiz Gui, watch the first part if you didn't in order to complete everything in the Video.
Remember that you can design the Gui as much as you want BUT DO NOT change it's location and name except if you know what you are doing. Hope It Works For You :)
MainScript :
local Quiz = "Why Was this quiz made?" -- Change this to your Question.
local Choice1 = script.Parent.Choice1
local Choice2 = script.Parent.Choice2
local Choice3 = script.Parent.Choice3
local CorrectChoice = Choice2 -- Change this to your Correct Choice
local Quiz2 = script.Parent.Parent.Quiz2
local MainQuestion = script.Parent.Question
Choice1.MouseButton1Down:Connect(function()
if Choice1 == CorrectChoice then
MainQuestion.Text = "Correct Answer!"
wait(1)
Quiz2.Visible = true
script.Parent.Visible = false
MainQuestion.Text = Quiz
else
MainQuestion.Text = "Wrong Answer!"
wait(1)
script.Parent.Visible = false
MainQuestion.Text = Quiz
end
end)
Choice2.MouseButton1Down:Connect(function()
if Choice2 == CorrectChoice then
MainQuestion.Text = "Correct Answer!"
wait(1)
Quiz2.Visible = true
script.Parent.Visible = false
MainQuestion.Text = Quiz
else
MainQuestion.Text = "Wrong Answer!"
wait(1)
script.Parent.Visible = false
MainQuestion.Text = Quiz
end
end)
Choice3.MouseButton1Down:Connect(function()
if Choice3 == CorrectChoice then
MainQuestion.Text = "Correct Answer!"
wait(1)
Quiz2.Visible = true
script.Parent.Visible = false
MainQuestion.Text = Quiz
else
MainQuestion.Text = "Wrong Answer!"
wait(1)
script.Parent.Visible = false
MainQuestion.Text = Quiz
end
end)