Need Help Fixing WeaponScript *(cant find compiler error)

Thanks in advance3 guys!

heres my script:

        function Start()
    {
    	SwitchWeapon
    }
    
    function Update()
    {
    	if(Input.GetKeyDown("1"))
    	{
    		SwitchWeapon(0);
    	}
    	else if(Input.GetKeyDown("2"))
    	{
    		SwitchWeapon(1);
    	}
    	else if(Input.GetKeyDown("3"))
    	{
    		SwitchWeapon(2);
    	}
    }
    
    funtion; SwitchWeapon(index : int)
    {
    	for(var i=0; i<transform.childCount;i++)
    	{
    		if(i==index)
    		{
    			transform.GetChild(i).gameObject.SetActiveRecursively(true);
    		}
    		else {transform.GetChild(i).gameObject.SetActiveRecursively(false);}
    	}
    }

The first error I notice is line 22 “funtion;” First of all it should be ‘function’ second You don’t need the ‘;’ in there. Secondly in the start function if you are trying to call the SwitchWeapon function it should be ‘SwitchWeapon(0);’

Finally where you have:

for(var i=0; i<transform.childCount;i++)

I’m pretty sure it should be

for(var i=0, i<transform.childCount, i++)

I may be wrong on that last one though. Out of interest what is it you are trying ot accomplish with this? There may be a better way to do it.

Those are the ones that jump put at me, try that and let me know if your still getting errors, for future reference if you get any syntax errors clicking on the notification at the bottom of your screen in unity should give you more details on where/how to fix them.