Thanks, Spellbreaker, but I'm puzzled. It works if I put the script in the script that changes to the new scene for the first time but if I put it in the scene as above, it doesn't work. Can't figure it out.
I have to put it in the scene.init as you can go to the scene from a wide variety of places. So it has to be set to a number before you go there from anywhere.