How do I make my knife stab in a tree?

I have my knife throwing script here, but how do I make my knife stab?
I tryed MyRigidbody.velocity =; Destroy (MyGameObject.GetCompponent());
MyRigidBody.isKinematic = true; etc.
Here is my throw script:

using UnityEngine;
using System.Collections;

public class Throwinit : MonoBehaviour {
	public Rigidbody knifePrefab;
	public Transform knifeSpawn;
	public float Speed = 750f;
	public float rotateSpeed = 750f;
	public int maxKnifes = 4;
	public int currentKnifes = 4;
	void Update ()
			if (maxKnifes <= 0)
			Rigidbody knifeInstance;
			knifeInstance = Instantiate(knifePrefab, knifeSpawn.position, knifeSpawn.rotation) as Rigidbody;
			knifeInstance.AddForce(barrelEnd.forward * Speed);
			knifesInstance.AddTorque(barrelEnd.right * rotateSpeed);
			maxKnifes = currentKnifes -1;
			currentKnifes = maxKnifes;

Can someone help me?

I’ve already sent this to moderation because it’s a duplicate. @mods Are you guys reading the comments before you accept them?