@Ottawa I whant to make a more flexible code so that I can use it everywhere. But thanks for the suggestion. It is so interesting to see what you al suggest. It helps a lot grin

@KiwiBoy I like your suggestion and made this action.

It works fine when it comes to pick up the box.

But when I turn around with it it kind of turn inside the player. And stays there until I turn again. How do I fix that?

And how do I make the player leave the box afther he has carried it to the place I whant?

Here are my action so far:
Code:
action my_box()
{

       while (!player) {wait (1);} // wait until the player is loaded

       while (vec_dist (player.x, my.x) >20) // this loop runs until the player picks up the box

       {        

		my.x = player.x +50;
      my.y =player.y;
      my.z =player.z +50;



if(key_l)//leave the box here
{
	//here I whant to be able to set the box down and leave it
	//maybee use vec_dist(player.x,my.x)>-200);//so the player cant "feel" the box  ????
	//then some code for leaving the box here......
	 set(my, INVISIBLE);//test if the program reacts
	 
}

               wait (1);
              	
       }


}


Last edited by Eagelina; 05/26/09 07:55.

A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile