Modme Forums

How to stop a Rotating Entity

Game Modding | Call of Duty: Black Ops 3 | Scripting


ModmeBot:

Thread By: Abnormal202

Currently I'm writing a script where a player stands on a pressure plate, and it starts rotating a script_model. I've got it to work fine using the RotateYaw function. The only problem is, I can't get it to stop when hits the right angles, or the right Yaw. I tried using the GetAngles function as:

angles = model GetAngles();
if(angles == (0, 180, 0))
{
    stop Moving or whatever
}



but it doesn't stop rotating ever.


ModmeBot:

Reply By: ZoekMeMaar

Abnormal202

Currently I'm writing a script where a player stands on a pressure plate, and it starts rotating a script_model. I've got it to work fine using the RotateYaw function. The only problem is, I can't get it to stop when hits the right angles, or the right Yaw. I tried using the GetAngles function as:

angles = model GetAngles();
if(angles == (0, 180, 0))
{
    stop Moving or whatever
}



but it doesn't stop rotating ever.

This may work,

function watch_model(model)
{
  time = 10;
  end_point = getent("endpoint", "targetname");
  while(1){
	if(model !IsTouching(end_point)){
	    model MoveTo( end_point.origin, time, 0, 0 );
	}
	else{break;}
  }
}


ModmeBot:

Reply By: Abnormal202

ZoekMeMaar
Abnormal202

Currently I'm writing a script where a player stands on a pressure plate, and it starts rotating a script_model. I've got it to work fine using the RotateYaw function. The only problem is, I can't get it to stop when hits the right angles, or the right Yaw. I tried using the GetAngles function as:

angles = model GetAngles();
if(angles == (0, 180, 0))
{
    stop Moving or whatever
}



but it doesn't stop rotating ever.

This may work,

function watch_model(model)
{
  time = 10;
  end_point = getent("endpoint", "targetname");
  while(1){
	if(model !IsTouching(end_point)){
	    model MoveTo( end_point.origin, time, 0, 0 );
	}
	else{break;}
  }
}

The only problem with that script is that the model is only rotating, not moving from place to place. However since the model I'm using is not a perfect circle perhaps I could get it to stop rotating when a part of it hits a script struct. Not sure if it will work but I'll try the touching method.


ModmeBot:

Reply By: ZoekMeMaar

Abnormal202
ZoekMeMaar
Abnormal202

Currently I'm writing a script where a player stands on a pressure plate, and it starts rotating a script_model. I've got it to work fine using the RotateYaw function. The only problem is, I can't get it to stop when hits the right angles, or the right Yaw. I tried using the GetAngles function as:

angles = model GetAngles();
if(angles == (0, 180, 0))
{
    stop Moving or whatever
}



but it doesn't stop rotating ever.

This may work,

function watch_model(model)
{
  time = 10;
  end_point = getent("endpoint", "targetname");
  while(1){
	if(model !IsTouching(end_point)){
	    model MoveTo( end_point.origin, time, 0, 0 );
	}
	else{break;}
  }
}

The only problem with that script is that the model is only rotating, not moving from place to place. However since the model I'm using is not a perfect circle perhaps I could get it to stop rotating when a part of it hits a script struct. Not sure if it will work but I'll try the touching method.

Oh then u could do a for

function watch_model(model, times_to_make_360)
{
  for(i=0; i < times_to_make_360; i++)
  {
    //rotate stuff here
  }
   
}