First of all you have to understand that FPS Creator's claim to fame is that you don't need to know any scripting to make a game, therefore there is no official scripting guide or tutorial. There are however a few good ones in the Official Community Guide, one of which (by me) explains the basics and about "states". States are nothing more than a means to navigate the lines in the script.
In each script, state starts at zero.(:STATE=0)It is parsed by the engine because the engine knows to start at 0.
The engine starts at the top of the script and checks each line to see whether or not to read it. When the engine gets to the line that says :STATE=0, it reads and processes that line. If the condition in that line is true, it executes the action in the line. If that action is STATE=1, then the STATE for this script is now changed to 1, and the engine will no longer read or execute a line that starts with :STATE=0, or anything else. It will only execute the lines that say STATE=1 until the state is again changed by another action.
There are exceptions to this rule, but not for this explanation.
In this way, we can tell the engine what conditions to check and actions to perform in relation to what it already knows and what has already happened.
Brian.