Hello everyone, I am working on a game and I wasn't having problems until I converted to .c files for the scripts instead of .wdl because I needed to use panels, but now when I go to call a function I get an error.

The error I get is "Crash in Main" when I press the space bar, which calls the gun_shoot() action. Any help is appreciated, below is the code for the main and gun_shoot().

Code:
action gun_shoot()
{
	ent_create("muzzleflash.mdl", vector(my.x + 130, my.y, my.z + 9), gun_flash);
	ent_create("bullet.mdl", vector(my.x + 135, my.y, my.z + 9), ball_fall);
	my.tilt += 15;
	wait (10);
	my.tilt -= 15;
	set(my,PASSABLE);
}

function main()
{	
	level_load ("Test.wmb");
	wait (2);
	while(1)
	{
		if (key_space == 1)
		{
			gun_shoot();
			wait(2);
		}
		else
		{
			wait(1);
		}
	}
}



Last edited by MattyTheG; 11/16/08 17:02.