Ok.. I am completely lost. This should at least make you freeze. I am trying to make a new menu in the form of the trading item without you dropping the items. I also have no clue on how it will change the GFX and you select it. Please help

.
NPC Code:
// NPC made by Rob Getashu
if (playerenters) {
toweapons -System NPC;
timeout=.05;
}
if (isweapon){
disableselectweapons;
}
if (keydown(8)&&!barup&&timeout){
set barup;
timeout=0.05;
}
if (barup&&timeout) {
setani idle,;
disabledefmovement;
timeout=0.05;
}
if (timeout) {
showimg 1,#W,playerx+1,playery-3.5;
}
if (keydown(1)&&timeout) {
play2 nextpage.wav,playerx,playery,1;
timeout=0.05;
}
if (keydown(3)&&timeout) {
play2 nextpage.wav,playerx,playery,1;
timeout=0.05;
}
if (keydown(8)&&barup&&timeout) {
unset barup;
enabledefmovement;
hideimg 1;
timeout=0.05;
}
timeout=0.05;