I don't have any problem when running your script, maybe
the problem is somewhere else in "act_warrior" or
"act_trapper".