Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is this returing true and false affter the 2nd time if you get it correct?

Asked by 8 years ago
--Hello, And welcome to the math factor experice, Today i code stuff :D
--Function Time :D
right = script.Parent.Math.Correct
fail = script.Parent.Math.Fail
script.Parent.Main.TextButton.MouseButton1Click:connect(function()
    a = script.Parent.Main.Get.Text
    script.Parent.Main:TweenPosition(UDim2.new(1, 0, 0, 0), "Out", "Bounce", 3)
    script.Parent.Math:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Bounce", 3)
    --Math Learning Part
    script.Parent.Math.Fact.Text = ""..a.."X1="
    script.Parent.Math.Check.MouseButton1Click:connect(function()
if script.Parent.Math.Answer.Text == tostring((a*1)) then
right.Visible = true
wait (5)
right.Visible = false
script.Parent.Math.Fact.Text = ""..a.."X2="
script.Parent.Math.Answer.Text = "Answer"
script.Parent.Math.Check.MouseButton1Click:connect(function()
if script.Parent.Math.Answer.Text == tostring((a*2)) then
    right.Visible = true
    wait (5)
    right.Visible = false
script.Parent.Math.Fact.Text = ""..a.."X3="
script.Parent.Math.Check.MouseButton1Click:connect(function()
    if script.Parent.Math.Answer.Text == tostring((a*3)) then
    right.Visible = true
    wait (5)
    right.Visible = false
script.Parent.Math.Check.MouseButton1Click:connect(function()
    if script.Parent.Math.Answer.Text == tostring((a*2)) then
    right.Visible = true
    wait (5)
    right.Visible = false
script.Parent.Math.Fact.Text = ""..a.."X4="
script.Parent.Math.Check.MouseButton1Click:connect(function()
    if script.Parent.Math.Answer.Text == tostring((a*4)) then
    right.Visible = true
script.Parent.Math.Check.MouseButton1Click:connect(function()
    if script.Parent.Math.Answer.Text == tostring((a*2)) then
    right.Visible = true
    wait (5)
    right.Visible = false
script.Parent.Math.Fact.Text = ""..a.."X5="
script.Parent.Math.Check.MouseButton1Click:connect(function()
    if script.Parent.Math.Answer.Text == tostring((a*5)) then
    right.Visible = true
    wait (5)
    right.Visible = false
    script.Parent.Math.Fact.Text = ""..a.."X6="
script.Parent.Math.Check.MouseButton1Click:connect(function()
    if script.Parent.Math.Answer.Text == tostring((a*6)) then
    right.Visible = true
    wait (5)
    right.Visible = false
    script.Parent.Math.Fact.Text = ""..a.."X7="
script.Parent.Math.Check.MouseButton1Click:connect(function()
    if script.Parent.Math.Answer.Text == tostring((a*7)) then
    right.Visible = true
    wait (5)
    right.Visible = false
    script.Parent.Math.Fact.Text = ""..a.."X8="
script.Parent.Math.Check.MouseButton1Click:connect(function()
    if script.Parent.Math.Answer.Text == tostring((a*8)) then
    right.Visible = true
    wait (5)
    right.Visible = false
    script.Parent.Math.Fact.Text = ""..a.."X9="
script.Parent.Math.Check.MouseButton1Click:connect(function()
    if script.Parent.Math.Answer.Text == tostring((a*9)) then
    right.Visible = true
    wait (5)
    right.Visible = false


else
    fail.Visible = true
    wait (5)
    fail.Visible = false
    script.Parent.Math.Answer.Text = "Answer"
end
    end)

else
    fail.Visible = true
    wait (5)
    fail.Visible = false
    script.Parent.Math.Answer.Text = "Answer"
end
    end)

else
    fail.Visible = true
    wait (5)
    fail.Visible = false
    script.Parent.Math.Answer.Text = "Answer"
end
    end)

else
    fail.Visible = true
    wait (5)
    fail.Visible = false
    script.Parent.Math.Answer.Text = "Answer"
end
    end)

else
    fail.Visible = true
    wait (5)
    fail.Visible = false
    script.Parent.Math.Answer.Text = "Answer"
end
    end)
    wait (5)
    right.Visible = false

else
    fail.Visible = true
    wait (5)
    fail.Visible = false
    script.Parent.Math.Answer.Text = "Answer"
end
    end)
else
    fail.Visible = true
    wait (5)
    fail.Visible = false
    script.Parent.Math.Answer.Text = "Answer"
end
    end)
else
    fail.Visible = true
    wait (5)
    fail.Visible = false
    script.Parent.Math.Answer.Text = "Answer"
end
    end)
else
    fail.Visible = true
    wait(5)
    fail.Visible = false
    script.Parent.Math.Answer.Text = "Answer"
    end
end)
end
    end)
end
    end)
end)

If you could help that would be nice. And yes i put weird stuff in my scripting. Do not judge me, If you wish to see what is happening the link is: http://www.roblox.com/games/420643628/Math-Facts

Answer this question