do you see anything wrong with the code?

I am trying to get the MsgBox to pop up when the scoreLeft or ScoreRight reaches 5 points or tie, but it is not instead I have to click on the pushbutton for the Message to appear; do you see anything wrong with the code?

if scoreleft = 5 then
MsgBox “Gongrats, player 1 you’re the #1 of the day!”
end if

if scoreRightt = 5 then
MsgBox “Gongrats, player 2 you win.”
end if

if scoreRight = 5 and ScoreLeft = 5 then
MsgBox “Gongrats, You got a tie.”
end if

What event contains this code?

Are scoreleft and scoreright both integers?

The second if-then scoreRight has a typo.

Better structure would be:

if scoreLeft = 5 and scoreRight = 5 then
msgBox “Congrats…”
elseif scoreLeft = 5 then
msgbox
elseif scoreRight = 5 then
msgbox
else
//someother score has occurred that you might want to capture.
end if

As currently you will get 2 msgboxes occuring for when they both hit 5.

Jim