i edited your code, i would make it different but for the sake of it, here u go -
set display mode 1024,768,32
backdrop on : color backdrop 0
set text font "times new roman" : set text size 16
set text transparent
sync on : sync rate 20
gosub Setup
do
gosub Control_Exp
gosub Control_Stats
sync
loop
`----------------------------------------------------------------------------------------
Control_Exp:
if returnkey()=1 then inc Experience,1
` if its ** "BIGGER" OR EQUAL ** than ExpA, then inc level and set experience to 0
if Experience >= ExpA
Inc Lvl
Experience = 0
endif
return
`----------------------------------------------------------------------------------------
Control_Stats:
center text 512,50,"Press RETURN-KEY to increase Experience Bar"
line 400,123,651,123 : line 400,133,651,133
line 399,123,399,134 : line 650,123,650,134
rem make the exp bar
Text 375,121,"Xp:" : Exp$=" "+str$(Experience)+" / "+str$(ExpA)
box 400,124,Experience+400,133,rgb(0,0,200),rgb(0,0,200),rgb(0,0,200),rgb(0,0,200)
text 490,105,Exp$
rem display character lvl
text 375,105,"Lv: " : Lvl$=" "+str$(Lvl) : text 395,105,Lvl$
return
`----------------------------------------------------------------------------------------
Setup:
rem stats
Lvl=0
Experience=0
ExpA=250
return