Hi,
After some try and error I made this:
sync on : sync rate 60
set display mode 800,600,32
nobx = 385
noby = 200
load image "scrollnob.tga",2,1
sprite 2,nobx,noby,2
hide sprite 2
load image "scrollbar.tga",1,1
sprite 1,350,200,1
hide sprite 1
do
text 0,0,"Nob: "+str$(nobx)
paste sprite 1,350,200
paste sprite 2,nobx,noby
if mousex() < nobx + sprite width(2) and mousey() < noby + sprite height(2)
if mouseclick()=1 and mousex() > nobx
nobx = nobx + 5
endif
if nobx > 689
nobx = 689
endif
endif
if mousex() < nobx + sprite width(2) and mousey() < noby + sprite height(2)
if mouseclick()=1 and mousex() < nobx
nobx = nobx - 5
endif
if nobx < 385
nobx = 385
endif
endif
sync
loop
It is working fine for me but the problem is that it decreases even when I click outside the sprite 2 on the clickable area. See the attach image and you will know.
Can someone tell me how to solve this?
Thanks

Your Signature Here;