Upgrade script unity 4 > unity 5

and my staff this script I did in unity 4 however tava functioning normally now spent for unity 5 and gave enough errors in the console. someone can update this script to me with the changes that happened in Unity5?

#pragma strict

// scripting

var fireplace : GameObject;
var cube : Transform;
var cubeGhost : Transform;

var AuxP : PlayerStats;

var buildSound : AudioClip;
var errSound : AudioClip;

var prefabActiveCube : boolean = false;

var layer : LayerMask;

var foundHit : boolean = false;

function Start()
{
AuxP = GetComponent(“PlayerStats”);
}

function Update ()
{
if(AuxP.Oopk == 10)
{
prefabActiveCube = false;
foundHit = false;
cubeGhost.transform.active = false;
}

if(Input.GetKeyDown(KeyCode.I) && AuxP.Oopk == 1){
foundHit = true;
}
building();
}

function building(){
if(foundHit == true){
var hit : RaycastHit;
foundHit = Physics.Raycast(transform.position, transform.forward, hit, Mathf.Infinity, layer);
prefabActiveCube = true;

if(hit.distance > 20){
cubeGhost.renderer.material.color = Color(1, 0, 0, 0.8);
if(Input.GetMouseButtonDown(0)){
audio.clip = errSound;
audio.Play();
}
}
if(hit.distance < 20){
cubeGhost.renderer.material.color = Color(1, 1, 1, 0.8);
}
if(Input.GetKey(KeyCode.Escape) || Input.GetMouseButtonDown(1)){
prefabActiveCube = false;
foundHit = false;
cubeGhost.active = false;
audio.clip = errSound;
audio.Play();
}
}

if(prefabActiveCube == true){
cubeGhost.position = hit.point;
cubeGhost.active = true;

if(hit.distance < 20){

if(Input.GetKey(KeyCode.E)){
cubeGhost.transform.Rotate(Vector3.up, 60Time.deltaTime);
}
if(Input.GetKey(KeyCode.Q)){
cubeGhost.transform.Rotate(Vector3.down, 60
Time.deltaTime);
}
if(Input.GetMouseButtonDown(0))
{
AuxP.Oopk2 = true;
Instantiate(cube, cubeGhost.transform.position, cubeGhost.transform.rotation);
cubeGhost.active = false;
prefabActiveCube = false;
foundHit = false;
audio.clip = buildSound;
audio.Play();
}

}
}

}

–Eric

nonoon -.-

If you want someone to help you, you may want to try to be more polite. Eric is right, you probably should edit your post using the code tags, it’s a lot easier to read and copy/paste (you want to help out the person helping you as much as possible).

That being said, have you tried using the API Updater included with Unity5? (Assets>Run API Updater…)