kk, also im having some trouble simplifying my code, i added a function to check if the mouse is over the selected area (to remove those unsightly "pyramids" of ifs in my loop) but ive never used functions b4

so i made a mistake somewhere. this code SHOULD run the same as the one above, but as u will see he clicking functionality no longer works.
sync on
maxhp#=50
hp#=19
dim weapons$(2) : weapons$(1)= "Blade of Uprising" : weapons$(2)= "Blade of Destruction"
dim weaponsdamages(2) : weaponsdamages(1)=5 : weaponsdamages(2)=15
dim weaponselements$(2) : weaponselements$(1)="Fire" : weaponselements$(2)="Doom"
currentweapon=1
numberofweapons=2
currenttask$="Find 20 Berries in the forest for Jane"
gold=75
maxmagic#=30
magic#=25
HPpotions=1
MPpotions=2
title$ = "Tale of A N006"
gosub make_images
do
`paste images and make sprites
paste image 1,0,0
paste image 2,0,380
paste image 3,100,380
paste image 4,200,380
paste image 5,450,400
`write info on potions and gold
ink rgb(250,0,0),hpbackcolor : center text 50,450,str$(HPpotions)
ink rgb(0,0,250),mpbackcolor : center text 150,450,str$(MPpotions)
ink rgb(250,250,0),1 : center text 250,450,str$(gold)
`write info on weapon
ink rgb(200,200,200),1
set text size 10
text 460,425,weapons$(currentweapon)
text 465,445,weaponselements$(currentweapon)
text 465,460,str$(weaponsdamages(currentweapon))
`make bars of HP and MP
ink rgb(250,0,0),1
hpratio#=hp#/maxhp#
box 50,5,(hpratio#*100)+50,25
line (hpratio#*100)+50,5,150,5 : line (hpratio#*100)+50,25,150,25 : line 150,5,150,25
ink rgb(100,100,250),0
mpratio#=magic#/maxmagic#
box 500,5,(mpratio#*100)+500,25
line (mpratio#*100)+500,5,600,5 : line (mpratio#*100)+500,25,600,25 : line 600,5,600,25
`type the current task
ink rgb(250,250,250),1
set text font "Times New Roman" : set text size 15
center text 325,55,currenttask$
`print the title logo
paste image 6,175,5
`ccheck for user clicking various buttons
if mouseover(0,380,100,480) = 1 and mouseclick()=1 and hpclickflag=0 then hpclickflag=1 : hpbackcolor=rgb(250,250,250) : dec hppotions : inc hp#,10 : if hp#>maxhp# then hp#=maxhp#
if mouseover(100,380,200,480) = 1 and mouseclick()=1 and mpclickflag=0 then mpclickflag=1 : mpbackcolor=rgb(250,250,250) : dec mppotions : inc magic#,10 : if magic#>maxmagic# then magic#=maxmagic#
if mouseover(450,400,640,480) = 1 and mouseclick()=1 and weaponclickflag=0 then weaponclickflag=1 : inc currentweapon : if currentweapon>numberofweapons then currentweapon=1
`return flags to neutral
if mouseclick()=0 then hpclickflag=0 : mpclickflag=0 : weaponclickflag=0
sync
cls
loop
make_images:
`make small purple ellipse for HUD top part
ink rgb(125,0,250),1
ellipse 320,100,320,100
get image 1,0,100,640,201
cls
`make a small red ellipse to be cut for the HP potions counter
ink rgb(250,0,0),1
ellipse 320,240,25,50
get image 2,270,140,370,240
cls
`make a small blue ellipse for the MP potions counter
ink rgb(0,0,250),1
ellipse 320,240,25,50
get image 3,270,140,370,240
cls
`small gold ellipse for the gold counter
ink rgb(250,250,0),1
ellipse 320,240,25,50
get image 4,270,140,370,240
cls
`this long block of line commands will draw a "sword"
ink rgb(200,200,200),1
line 320,240,336,228
line 320,240,336,252
line 336,228,436,228
line 336,252,436,252
line 436,228,436,208
line 436,252,436,272
line 436,208,441,208
line 436,272,441,272
line 441,208,441,233
line 441,272,441,247
line 441,233,491,233
line 441,247,491,247
line 491,233,491,247
get image 5,320,208,495,276
cls
`make a logo of the game title
set text font "Algerian" : set text size 30
currentcolor=1
for x = 1 to 15
if currentcolor=1 then ink rgb(250,0,0),1
if currentcolor=2 then ink rgb(0,250,0),1
if currentcolor=3 then ink rgb(0,0,250),1
text (20*x)+100,240,mid$(title$,x)
inc currentcolor : if currentcolor=4 then currentcolor=1
next x
get image 6,120,230,420,280
cls
return
function mouseover(x1,y1,x2,y2)
if x1<mousex() and mousex()<x2 and y1<mousey() and mousey()<y2
exitfunction 1
else
exitfunction 0
endif