This script will not work.
Any and all "if or elseif" statements should never touch the far left hand side of your editor.This will not allow the rest of the scripts statements to be read.
Plus you have an extra brace in this script that is causing this problem.
Anyone can copy paste... but knowing how to fix an error when you have copy pasted a script wrong by leaving out a piece of code results in a script like this.
I don't know if you guys are purposely posting scripts that are that have errors for others to post fixes or what, but at least try and post something that's usable by others cause it defeats the purpose of event making the post.