Your “ms” object is null. If “Main” is a script, you have to do following: ms = GetComponent<Main>();
ms = GetComponent<Main>();
Please have a look here for proper usage of code tags: