I use another method,the picture is assigned to the entity in the definition.Here is the script:
action roll()
{
while (1)
{
my.roll += 5 ;
my.roll %= 360;
wait (1);
}
}
entity tupian
{
type = <fangxp.png>; //the picture that I want to rotate
layer = 85;
flags = visible;
x = ...;
y = ...;
z = ...;

event = roll;
}
the picture appears on the screen,but the function roll didn't work,in other words the picture doesn't rotate,why?why can't the function do effect?