hehe ok well i dont know what thebug was, but when i ran the code you gave it kept saying zeor damage, cause you forgot to get rid of the # on damage, btu i've fixed it and a few other bits, now it runs good.
[edit] oops just read your little rem line, and yeah i see what it was. ohwell all working now thanks van. could use this sort of engine to run the battles on the dark phantasy game, atleast a more advanced version. By the by, any mor ework on the syndicate game yet?
`d20 rolling battle system
hp=30
do
set cursor 10,10
print "D20 ROLLER BY UBERWIGGETT WERD POWER"
set cursor 20,20
print "enemie's hp is:",hp
set cursor 50,50
print "Press R to roll for attack"
`It was missing each time because roll is always <12 at startup
if inkey$()="r"
gosub rollattack
if roll>12 then gosub damage
if hp<0 then gosub ending
if roll<12 then gosub miss
endif
loop
rollattack:
roll=rnd(19)+1
set cursor 100,100
print "you rolled:",roll
suspend for key
wait 300
cls
return
damage:
damage=rnd(5)+1
hp= hp-damage
set cursor 100,100
print "you did ",damage;" damage!"
suspend for key
wait 200
cls
return
miss:
set cursor 100,160
print " You fail to hit the enemy."
suspend for key
cls
return
ending:
cls
set cursor 100,100
print " The enemy has been bested. YOU WIN!"
suspend for key
end