aL BeasTie
Well-known member
I made a basic didhitscript for a powerup item that will add +1 to the players speed. Default speed is 5 default run speed is 10
I think I have the walking sorted but I'm not sure exactly how to control running effectively. It is working but it adds too much speed. I recall using speed from script is more like speedf so we can use decimals, not sure if running does thou. I also tried using run.speed.x which still worked fine but I wasn't sure how to get run.speed.x value using script. Also I started adding so it has a maxspeed cap so you can't raise it too high but again I had problems storing the 'running' values.
Code:
void main()
{
void self = getlocalvar("self");
void target = getlocalvar("damagetaker");
int spd = getentityproperty(target, "speed");
int rspd = getentityproperty(target, "running", 0);
changeentityproperty(target, "speed", spd+0.1);
changeentityproperty(target, "running", +2);
}
I think I have the walking sorted but I'm not sure exactly how to control running effectively. It is working but it adds too much speed. I recall using speed from script is more like speedf so we can use decimals, not sure if running does thou. I also tried using run.speed.x which still worked fine but I wasn't sure how to get run.speed.x value using script. Also I started adding so it has a maxspeed cap so you can't raise it too high but again I had problems storing the 'running' values.