Instead of attempting to shove scripts together then posting on the forums asking why they don't work, why not take the time to learn the basics of the language?
Learning simple structure and syntax is the first thing to learning a new language...
You wouldn't try to learn German by shoving random sentences together and hope they produce what you want...
There are a lot of resources available, if you would actually look.
GS2 Wiki
Old Wiki (But has some things the new one doesn't)
Look through the code gallery at other people's scripts to get a good idea of what GS2 is, then try writing some basic code. (Note: I did not say copy/paste the codes, that would be pointless. Read through them and try to understand what they are doing)