Clicking on a Showimg

I know that it probably has something to do with that in|a,b| stuff, But I still can’t figure it out…

if(playerenters || timeout){
 showtext 322,15,150,,,@[email protected] Everybody;
 changeimgvis 322,4;
 changeimgzoom 322,.75;

 if(mousescreenx in |15,100| && mousescreeny in |150,175|)
  changeimgzoom 322,1;

 timeout=0.05;
}

if(mousedown){
 if(strequals(#p(0),left)){
  playerdir=2;
  if(mousescreenx in |15,100| && mousescreeny in |150,175|)
   setlevel2 level.nw,30,30;
}

Something like that…

Hmmm so it would involve mousescreen x/y? I assumed it involved mousey/x…
0.o

___Merged doublepost__________________

How would I make it so I can click on it if it is fixed on screenheight/2 and screenwidth/2?

___Merged doublepost__________________

xD nevermind I got it.

Depends on the layer the showimg is on. Is it in the level, or the screen?

[code]if (created) {
this.showx = 50;
this.showy = 50;
setstring this.showimg,door.png;

showimg 200,#s(this.showimg),this.showx,this.showy;
changeimgvis 200,4;
}

if (mousedown && leftmousebutton) {
if (mousescreenx in |this.showx,this.showx+imgwidth(#s(this.showimg))| &&
mousescreeny in |this.showy,this.showy+imgheight(#s(this.showimg))|) {
ImageClicked();
}
}[/code]
I think that would work.

[code]// NPC made by Yenairo
if (playerenters){
toweapons -death;
timeout= 0.05;
timereverywhere;
}
if((timeout||playerenters)&&isweapon){
timeout = 0.5;
if(strtofloat(#s(client.hp))=<0){
showtext 322,screenwidth/2,screenheight/2,@#b@#v(strtofloat(#s(clientrespawn)));
changeimgvis 322,4;
changeimgzoom 322,.75;
if(mousescreenx in |screenwidth/2,screenwidth/2+64| && mousescreeny in |screenheight/2,screenheight/2+16|)
changeimgzoom 322,1;
}
if(mousedown){
if(strequals(#p(0),left)){
if(mousescreenx in |screenwidth/2,screenwidth/2+64| && mousescreeny in |screenheight/2,screenheight/2+16| && strtofloat(#s(client.respawn)) == respawn)
setlevel2 onlinestartlocal.nw,34,25;
}
}
}

if(strtofloat(#s(client.hp))==0){
setstring client.dead,1;
sleep 1;
setstring client.dead,0;
}

if(strtofloat(#s(client.dead))==1){
setani dead,;
freezeplayer 100;
setstring client.respawn,5;
setstring client.respawn,client.respawn-1;
sleep 1;
setstring client.respawn,client.respawn-1;
sleep 1;
setstring client.respawn,client.respawn-1;
sleep 1;
setstring client.respawn,client.respawn-1;
sleep 1;
setstring client.respawn,client.respawn-1;
sleep 1;
}[/code]

Can someone look at this?
I want it to be a respawn and make it so it doesn’t let you click untill it says “respawn”.
I cant seem to get it right x.x