#remember "#" is a comment
%PLAYERATCK = 5 # this is players attack, developed throughout game, 5 is eg.
%PLAYERDEF = 6 # this is players defense, same as above, 6 is eg.
%PLYRHEALTH = 10 # this is the players health, same as above, 10 is eg.
%MONSTRATCK = 7 # this is the "monsters" attack value, a set value, 7 is eg.
%MONSTRDEF = 4 # this is the "monsters" defense value, a set value, 4 is eg.
%MONSHEALTH = 10 # this is the "monsters" defense value, a set value, 10 is eg.
#following script is for a link that says "ATTACK MONSTER"
IF %PLAYERATCK > %MONSTRDEF THEN
%DAMAGE = %PLAYERATCK - %MONSTRDEF #find difference between stats and store
%MONSHEALTH = %MONSHEALTH - %DAMAGE #take the damage and substract from health
ELSE IF %PLAYERATCK < %MONSTRDEF THEN
%DAMAGE = %MONSTRDEF - %PLAYERATCK #find difference between stats and store
%PLYRHEALTH = %PLYRHEALTH - %DAMAGE #subtract from health
$DEST = @C #to whatever page you want, or even the current page to reselcet options
# above is very simple, it doesnt incorporate anything else, if you wanted to, you could incorporate health, but i want you to learn basic first...
from the $DEST line, if you were to go to the current page, the current page would contain:
Players health, players attack, players defence, monstershealth (you can include the "monsters" stats, but that would ruin the battle aspect) and then your links would be, Attack Monster, Use Items (eg health increase pills i dunno whatever), Run Away, and then when you attaack the monster, you will be brought to the current page where the players health will be updated and the monsters health will be updated, and then more scriptign can be used to show the "results" of the attack.,