First of all = wrong forum if you are searching for a fix to some code (Scripting forum);
However, you could solve your problem in several ways:
a) if you just want to show the book over the desk on mouse click, probably you just need a model with two frames, one with just the desk and the other frame with the desk and the book over it, and change the frames with mouse click;
b) if you need to aplly some physics code to the book either, you could use some kind of attach code:
Code:
entity* deskEntity;
entity* bookEntity;
action desk
{
deskEntity=my;
while(bookEntity==null){wait(1);}
while(1)
{
temp.x=my.x;
temp.y=my.y;
temp.z=my.z + 100;//play with this value
vec_for_vertex(temp,my,80);//play with the vertex number to attach book
vec_set(book.x,temp);
//insert here the code to move or rotate the desk vg. C_move, etc...
wait(1);
}
}
action book
{
bookEntity=my;
//my.invisible=on;
//etc...
}
I hope it helps.