From what I remember, gotoposition() must have three arguments, the third being whether the player is flipped or not. Try messing with that and see if that fixes it. Though Shiny does have a point, if your script is just one internal command you don't even need all the funny notation, just the single command and exactly one empty line in the script.