I was trying to actually paste the code into TyranoBuilder, and got an error message I really don't understand. It's not very good at elaborating on the source of errors.
Error:_preview.ks:23:An error occurred. check the scenario script.
So far I haven't gotten any kind of javascript to run in Tyranobuilder and it's getting frustrating. Any help is appreciated.