STATE=X is true when the value stored in the FPI script is equal to X
fpi scripts are "trigger based" and they use a simple "if/then" type of syntax. In other words, they check the value of predefined conditions to see if they meet a criteria, and then perform an action, based on that value.
STATE is a condition. When you see the condition "STATE=1" in a script, that means that the engine will check the value of STATE to see if it equals 1. If so, the engine continues to process that line, or "statement". If not, the engine moves on to the next statement. So STATE is used to control the progression of the script.
STATE is also an action. When you see the action "STATE=1" in a script, it means that STATE is being given a value of 1. Why, you may ask? In order for us to control the sequence of events using the value of STATE. Like if we want an action to continue while STATE=1 and not to stop until STATE=2.
STATE's position in the script determines whether it is a condition or an action: After the first colon it is a condition and after the second colon it is an action.
:condition:action - or - :state=1:state=2
Understanding this is one thing, but relating or teaching it something completely different. For those who have a background in programming languages, such as Basic, this is a simple concept. For those with no experience, it's like learning another spoken language, even harder if you speak other than English.
The best way to learn this is to take the information here and in Nick's guide, then look at the scripts in your scriptbank folder. Follow the progression in your head and see how each condition is checked and what actions are taken based on the results.
For more on this, see the scripting tutorial in Nickydudes guide. (link above)
best.
I'm sorry, my answers are limited. You must ask the right question.