Originally Posted By: DevoN
I converted the lite-c code to c-script; and I've found a bug..



it creates it at the worlds center pos.. any ideas?


It looks like you added the whole script to the action, I see that there's another sword to the screen. Actually, you only need to add this to the beginning(variable declaration) of your sword action or sword holding entity

Code:
VECTOR trailpos1;
	VECTOR trailpos2;
	VECTOR trailpos3;
	VECTOR trailpos4;
	ENTITY* trail1;
	var speed = 0;



and add this in the same action, before the wait(1):
Code:
if(speed%2==0)
		{
			trail1 = ent_create("trail1mdl.mdl",my.x,trail);
			vec_for_vertex(trailpos2,me,74); //change 74 to vertex no of the sword tip
			vec_for_vertex(trailpos1,me,75); //change 75 to vertex no of the sword base
			vec_to_mesh(trailpos1,trail1,1);
			vec_to_mesh(trailpos2,trail1,2);
			vec_to_mesh(trailpos3,trail1,3);
			vec_to_mesh(trailpos4,trail1,4);
			vec_set(trailpos3,trailpos1);
			vec_set(trailpos4,trailpos2);
		}



oh, and convert the above code to C-script first grin