I already converted all the global vars to local but i am getting lots of weired errors. Can someone try their expertise to fix it?

If fixed It will be a very usefull script to contribute to all the people of 3dgs specially newbies laugh