# Help with "if" and "else" statements

**URL:** <https://forum.kirupa.com/t/help-with-if-and-else-statements/281672>\
**Category:** programming\
**Created:** [February 12, 2009, 1:46am UTC](https://forum.kirupa.com/t/help-with-if-and-else-statements/281672 "2009-02-12T01:46:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scimitar255](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@scimitar255](https://forum.kirupa.com/u/scimitar255)\
**Post date:** [February 12, 2009, 1:46am UTC](https://forum.kirupa.com/t/help-with-if-and-else-statements/281672/1 "2009-02-12T01:46:13Z")

</div>

Ok, I’m sorry if this is a really basic problem, but I can’t figure out for the life of me what is wrong.

I want to go to a “win” frame once I get a certain score right? So here’s my code: (applied to the frame)

\_root.score.text = 0;

if (\_root.score.text=8) {  
gotoAndStop(“win”);  
} else {  
(\_root.score.text=0);  
stop();  
}

But the problem is every time i load it the score says 8 (and it takes me to the win message anyways). And if i put in two == signs, it runs normally but it doesn’t take me to the win message.

Thanks in advance
