spell casting problem

ok so i try to create a basic fire spell using a mesh particle emmiter prefab that i created. it works inside the unity program but not on the built exe. At first i though it was my menu feature that was causing the problem, not the case, tried running without the menu same problem. this is the spell script i used`#pragma strict

var spell:Transform;
var cooldown:float =  1.5;
private var castimen : float = 0.5;
var mana: int = 50;

var spellsound: AudioClip;
var charges: AudioClip;

var oom: boolean = false;

function Update () {
if(Input.GetButton("Fire1")&&Time.time > castimen)
 if(mana  > 0){

if (oom){
		oom = true;
		oom = false;
function Cast(){
	castimen = Time.time + cooldown;

var shot = Instantiate(spell, transform.position, Quaternion.identity);
shot.rigidbody.AddForce (transform.forward * 3000);
function charge(){
mana = 50;

` please help i’ve no idea where to go from here.
thanks for your comments, what i am trying to do is instantiate the object “Spell1” as a rigid body and add force in the forward direction, however when it is built the object never even appears, also the object itself has a script attached to it that tells it to destroy itself after 3 seconds.

the variable spell is a Transform. Therefore if you Instantiate it you will probably get a Transform, not a GameObject. I have no idea why this works in the editor, imo it shouldn’t. Try changing the type of spell to GameObject instead.