Help with Minecraft Building Script

Hey Guys Im not good at scripting but I have a Minecraft Building Script with that my Character Controller can build and destroy primitive Cubes with no textures.
So my question is if somebody could make that the blocks that I am building have textures and make a sound if I place or destroy them.
Is that possible please help Thank you for all people who help me!
Here is the Building Script:

var blockLayer : LayerMask = 1;
var range : float = Mathf.Infinity;
var hit : RaycastHit;

function Update () {
    if (Input.GetMouseButtonDown(0))
        Build();
    if (Input.GetMouseButtonDown(1))
        Erase();
}

function Build() {
    if (HitBlock()) {
        var cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
        cube.transform.position = hit.transform.position + hit.normal;
    }
}

function Erase() {
    if (HitBlock())
        Destroy(hit.transform.gameObject);
}

function HitBlock() : boolean {
    return Physics.Raycast(transform.position, transform.forward, hit, range, blockLayer);
}

Just look it up in the Unity docs.

You can do this Unity - Scripting API: Material.SetTexture

or you could set the material from a pre-created material in the project editor by doing

var myMaterial1 : Material;

cube.renderer.material = myMaterial1;

or you could set the color alone, or if you want to change the color but keep the texture you can do

cube.renderer.material.color = Color(R,G,B,Transparency);

reference to this is here:

MainTexture might be the easiest because you don’t need to create a material, just a picture in your project view and drag it in.