using RPC for a chat (with photon)

im trying to get my chat to work in my game, it uses photon server, im trying to use RPC for it, but since my knowledge of RPC is very limited im unable to get it to work and im not sure if im even on the right track

the way it currently is, i keep getting the error message “Assets/Standard Assets (Mobile)/Scripts/ChatScript.js(216,10): BCE0047: Non virtual method ‘UnityEngine.Component.SendMessage(String)’ cannot be overridden.”

here’s the full script, any help would be greatly appreciated

public class ChatScript extends Photon.MonoBehaviour{
     	     	     	
     	private var dt = Date();
     
        private var log:Array = new Array();
     
        var maxLogMessages:int = 200;
     
        var visible:boolean = true;
     
       
     
        var stringToEdit : String = "";
     
        var selectTextfield : boolean = true;
     
     
     
        function Start()
     
        {
     
            Input.eatKeyPressOnTextFieldFocus = false;
     
            log.Add("Welcome to the Global Chat.");
     
           
     
        }
     
        function print(string:String)
     
        {
     
            log.push(string);
     
            if(log.length > maxLogMessages)
     
                log.RemoveAt(0);
     
        }
     
         
     
        private var scrollPos:Vector2 = Vector2(0, 0);
     
        private var lastLogLen:int = 0;
     
        var printGUIStyle:GUIStyle;
     
        var maxLogLabelHeight:float = 100.0f;
     
         
     
        function OnGUI()
     
        {
     
            if(visible)
     
            {
     
     
                    GUI.SetNextControlName ("chatWindow2");
                    GUI.TextField (Rect (0.0, 5000, 20, 20), "", 25);
                    
     				if(!selectTextfield) {
     				GUI.SetNextControlName ("chatWindow");
                	stringToEdit = GUI.TextField (Rect (0.0, Screen.height - 50, 200, 20), stringToEdit, 25);
     				GUI.FocusControl ("chatWindow");
               		}
     
                	else if (selectTextfield == true) {
     
                    GUI.FocusControl ("chatWindow2");    
     
                    }
     
                   
     
                var logBoxWidth:float = 180.0;
     
                var logBoxHeights:float[] = new float[log.length];
     
               
     
                        // calculate full height of scrollview
     
                var totalHeight:float = 0.0;
     
                var i:int = 0;
     
                for(var string:String in log)
     
                {
     
                    var logBoxHeight = Mathf.Min(maxLogLabelHeight, printGUIStyle.CalcHeight(GUIContent(string), logBoxWidth));
     
                    logBoxHeights[i++] = logBoxHeight;
     
                           
     
                    totalHeight += logBoxHeight+10.0;
     
                }
     
     
                var innerScrollHeight:float = totalHeight;
     
               
     
                        // if there's a new message, automatically scroll to bottom
     
                if(lastLogLen != log.length)
     
                {
     
                    scrollPos = Vector2(0.0, innerScrollHeight);
     
                    lastLogLen = log.length;
     
                }
     
               
     
                scrollPos = GUI.BeginScrollView(Rect(0.0, Screen.height-150.0-50.0, 200, 150), scrollPos, Rect(0.0, 0.0, 180, innerScrollHeight));
     
               
     
                var currY:float = 0.0;
     
                i = 0;
     
                for(var string:String in log)
     
                {
     
                    logBoxHeight = logBoxHeights[i++];
     
                    GUI.Label(Rect(10, currY, logBoxWidth, logBoxHeight), string, printGUIStyle);
     
                    currY += logBoxHeight+10.0;
     
                }
     
                GUI.EndScrollView();
     
            }
     
        }
     
       
       
     
        function Update () {
        
        var day = dt.Now.Day;
        var month = dt.Now.Month;
        var year = dt.Now.Year;
        var hours = dt.Now.Hour;
        var minutes = dt.Now.Minute;
        var seconds = dt.Now.Second;
     
       
       
     
        if(Input.GetKeyDown("return")) {
     
       
     
        if(selectTextfield) {
     
       
     
        selectTextfield = !selectTextfield;
     
       
     
        }
     
     
        if(stringToEdit != "") {
        
        if(stringToEdit == "/") {
        
        }
     
        else {
        
     
        photonView.RPC("SendMessage", PhotonTargets.All, MovementScripttt.playerName + ": " + stringToEdit );
     
        }
     
        selectTextfield = true;
        
        stringToEdit = "";
     
     
        }
     
        }
     
        }
        
        
        
        
@RPC
function SendMessage (mess : String)
{
	log.Add(mess);
}


}

Too many spaces in your code!

Unity already has an inbuilt method called SendMessage, this is what the error is trying to tell you :

Non virtual method 'UnityEngine.Component.SendMessage(String)' cannot be overridden

Use a different name for your function like SendChatMessage instead.