ondrawscript @script
void main() {
void self = getlocalvar("self");
void time = openborvariant("elapsed_time");
void elapsed_time = openborvariant("elapsed_time");
float x = getentityproperty(self, "x");
float z = getentityproperty(self, "z");
float y = getentityproperty(self, "y");
float base = getentityproperty(self, "base");
// store coords
if ( getlocalvar("x") == NULL() ) setlocalvar("x", x);
if ( getlocalvar("y") == NULL() ) setlocalvar("y", y);
// time start time to 0
if ( getlocalvar("start_time") == NULL() ) setlocalvar("start_time",time);
time -= getlocalvar("start_time");
x = getlocalvar("x") - sin(time/1.45)*2;
y = getlocalvar("y") - cos(time/1.45)/3;
changeentityproperty(self, "tosstime", elapsed_time+1) ;
changeentityproperty(self, "position", x, NULL(), y) ;
}
@end_script