Hey Alex,
I am not really sure what the code is supposed to do. But I imagine you are getting some problems due to some coding errors. (Such as while loops without waits).
You would need to format the code correctly. (It would look something like this)
Code:
FUNCTION computer_player
{
computer = me;
while (computer !=NULL)
{
me.vec[0] = you.vec[0]-60;
me.vec[1] = you.vec[0]-60;
if(key_g ==1)
{
me.vec[0] = you.vec[0]+60;
me.vec[1] = you.vec[0]+60;
}
if(key_b==1)
{
me.vec[0] = you.vec[0]-60;
me.vec[1] = you.vec[0]-60;
}
wait(1);
}
}
ACTION player_action
{
my.gravity = 3;
my.z_offset = 6;
player = my;
my.shadow = on;
ent_create("sword.mdl",my.x,attach_weapon);
ent_create("player2.mdl", you.x, computer_player);
ent_create("player.mdl", my.x);
while(me)
{
if(key_q==1)
{
if(player1.state_skill==1 && Player2.state_skill== 0)
{
ent_remove (my);
me = ent_add ("player2.mdl", my.x);
ent_remove(you);
you = ent_add ("player1.mdl",you.x);
}
else
{
if(player1.state_skill==0 && Player2.state_skill== 1)
{
ent_remove (my);
me = ent_add ("player1.mdl", my.x);
ent_remove(you);
you = ent_add ("player2.mdl",you.x);
}
}
}
wait(1);
}
}
Could you give us a bit more detail as to what you want the code to do in game, and what the actually error is.
Good luck,
Static