clientside
NPC Code:
//#CLIENTSIDE
if (playerenters){
this.sw=imgwidth(#f)/16;
this.sh=imgheight(#f)/16;
}
if (playerenters||timeout){
if (playerx in {x,x+this.sw-2}&&playery in {y,y+this.sw-2}){
attachplayertoobj 0,id;
drawunderplayer;
}elseif (playerattached){
playerx+=vecx(playerdir)*.5;
playery+=vecy(playerdir)*.5;
detachplayer;
drawoverplayer;
}
timeout=.05;
}
may not work, because im typing it on my laptop at school lol
im 95% sure #f is the npcs image hehe but ive not used it alot so i dont know lol
i hope it works, let me know okay?
remeber to set the image or it wont work lol