Looks like you're missing a few )s and a } there.
Code: ags
This should work.
//character attack------------------------------
if(Random (20)<(getstats(1,4)-(getstats(2,1)))
{
setstats (2,2,getstats(1,3)-Random (3));
Display ("You swing and hit");
}
else if (Random (20)>(getstats(1,4)-(getstats(2,1)))
{
setstats (2,2,getstats(1,3)-Random (3));
Display ("You swing and miss");
}
This should work.