I am not into music, so I'll try to fix the 'weapon' problem first

At the beginning, you should think of "how many weapons / shields / overall equipment should my character be able to handle at the same time".
If there's more than one weapon and one shield, the code will have either a very complex structure - or it will be just more, nearly copied code.

But I assume you want to have just one / one, so lets start with that.

We have to create an array, where the items found can be stored in.
Code:

var equipment[4]; //0-1: weapon id and weapon handle, 2-3: shield id & handle



Then, lets say "0" is "weapon", and "1" is "shield". What to do with the last one, "2", is left to you. Save something important to it.

Now, its getting more complicated. We have to create 2 event functions for the models, one for the little knight and one for the weapon/shield model.
knights event: EVENT_DETECT -> my.enable_detect = on;
weapons event: EVENT_SCAN -> my.enable_scan = on;

The player has to scan for weapons every frame, so we've to call "c_scan" every frame, e.g. in the main loop.

If the Detected-event of the player is called, we have to check if it is a weapon/shield, and we have to equip the player with the found one (if any).

Code:

EVENT_DETECT called
{
if( you == a weapon )
{
you.skill100 = 1; //to remove the weapon, check this in the weapons main loop
equipment[ _weapon ] = you.skill1; //the id of the weapon/shield
//thats it. you could check if there is already a weapon in the players hand, and add more info
}
}



Yeah, the weapon got removed from the level and "equipment" has the relevant infos about it.

The next thing now:
We have to check (in the player's function) if equipment[0] and [2] are set, and if they are, whether the [1] and [3] contain the entity handles.
If they do not, as in our example here, we have to create a weapon/shield and set them.
Code:

you = ent_create(weapon/shield); //we have to create the items by the ID given in 'equipment'
equipment[ _weapon ] = handle( you );
//or
equipment[ _shield ] = handle( you );



Okay, the handles exist. We can get the pointers by "ptr_for_handle( equipment [ shield ] )"

We go on with the movement:
if the handle exist, lets receive the pointer and move it by the players side!
Code:

you = ptr_for_handle( equipment [ _weapon ] );

vec_set(temp.x, vector(0, 100, 0));//vector(0, -100, 0) for the shield
vec_rotate(temp.x, player.pan);
vec_add(temp.x, player.x);

vec_set(you.x, temp);
vec_set(you.pan, player.pan);



Thats it.

I hope the code works and my explanation was not that hard to understand

Regards
Sinthoras