I can tell you why I didn't answer to your post.
It is because of this phrase: "a working code sample" - when I read something like that I expect someone who isn't willing to take the effort to learn coding.
There have been too much requests where someone from the forum wrote the whole code, and result was that the requester didn't learn from it, but requested another code snippet and another and so on.
If you are satisfied with hints as well, then I, and others, can give you some.
These are the tasks that the requested code has to solve:
- placing a sprite at a certain position --> needed instruction: vec_set
- getting the position of a certain vertex of the ball.mdl --> needed instruction: vec_for_vertex and the pointers you and my
- moving the ball.mdl --> needed instruction a while loop with a wait(1) which continuesly changes the value of the position
- keeping the position of the sprite at the position of the certain vertex of the ball.mdl --> needed instruction: repeatedly vec_for_vertex
- this means that one of both entities needs to store the 'identity' of the other entity, and set the you pointer to it --> needed instructions: handle() and ptr_for_handle and a skill
You see, your requested code could be as complicated as the examples in the manual and even more.
There might be an example of a code quite similar to what you requested in the AUM, but it isn't easy to find.
One forum member made an index for the AUM, but I don't recall his name.