yea testDummy is correct, you can't use string1 == string2, you actually have to use str_cmpi in you if statement

Code:
string Unit_Type;
function AI_Fight()
str_cpy(Unit_Type,my.string1)
if(str_cmpi(Unit_Type, "guard"))
{
do_something;
}


That's also case insensitive, aka GUARD would work just as well as guard, if you don't want that, change str_cmpi, to str_cmp