He didn't give you a working script, he gave you somewhat of an outline.

And don't take screenshots of your code, just copy it to the forum in [code] [ /code] tags or to a pastebin.

And that script contains everything you need to add already. A text event, setting a variable, a comparison, and returning.