Change this line:
if mousex()=>sprite x(1) and mousex()=<sprite x(1)+50 and mousey()=>sprite y(1) and mousey()=<sprite y(1)+50
to this:
if mousex()=>sprite x(1) and mousex()<sprite x(1)+sprite width(1) and mousey()=>sprite y(1) and mousey()<sprite y(1)+sprite height(1)
This way, it doesn't depend on a 50x50 sprite being used and can use any size sprite
Also, if you change this line:
sprite 1,mousex(),mousey(),1
to this:
sprite 1, mousex()-(sprite width(1)/2), mousey()-(sprite height(1)/2), 1
Then the mouse will be centred on the sprite instead of the top left