HEAD PIC THINGEH!

I started working on this headpic thing this morning. It’s supposed to show the player’s head and NOT show the weapon (still does that) that the player is using. So far I’ve managed to remove the main stats, show the player’s nickname. Here’s the code and some in-game pictures, I hope someone can help fix my crap up :stuck_out_tongue:

// NPC made by benjiro and tricxta
if (playerenters || timeout){
  if (!isweapon)toweapons -headpic;
  this.placex=strtofloat(#s(client.headpx));
  this.placey=strtofloat(#s(client.headpy));
  showimg 500,noddess_head-pic.png,this.placex,this.placey;
  changeimgvis 500,4;
  showtext 503,this.placex + 20,this.placey + 45,arial,l,#n;
  for (this.i=502;this.i<507;this.i++){
    changeimgcolors this.i,,,,;
    changeimgzoom this.i,.6;
    changeimgvis this.i,5;
  }
  showimg 511,#W,this.placex + 23-(imgwidth(#W)/2),this.placey + 24 -(imgheight(#W)/2);
  changeimgzoom 511,.7;
  changeimgvis 511,5;
  if (leftmousebutton && mousescreenx in |this.placex,this.placex+250| && mousescreeny in |this.placey,this.placey+80|){
    setstring client.headpx,#v(int(mousescreenx)-125);
    setstring client.headpy,#v(int(mousescreeny)-40);
  }
  else hideimg 513;
  timeout=0.05;
}

Steal my HUD V1 to find the math for the head facing forward.

see this line here: showimg 511,#W,this.placex + 23-(imgwidth(#W)/2),this.placey + 24 -(imgheight(#W)/2);
thats what you gotta change to show the head. So it will be come:
showimg 511,#3,this.placex + 23-(imgwidth(#W)/2),this.placey + 24 -(imgheight(#W)/2);
And then you can make it that little bit better by using this right afterwards
changeimgpart 511,0,(playerdir*32),32,32;