Modme Forums
Menu:

Stop an entity to move

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


ModmeBot:

Thread By: Pipi
How can you move a model only if the player keep touching a trigger?


ModmeBot:

Reply By: mathfag

Pipi
How can you move a model only if the player keep touching a trigger?


model = getent("model_name","targetname");
trig = getent("trigger_name","targetname");

while(1)
{
trig waittill("trigger", player);

//model moveto(<point>,<time>,[acceleration time],[deceleration time]); //point is script origin name. define if above
//or
//model movex(<point>,<time>,[acceleration time],[deceleration time]); //you can also use movez or movey


//example. it will move 100 units over 1 second, wait 1 second and check if the player is still on the trigger

model movex(100,1);

wait(1);

}</time></point></time></point>

never tested this


ModmeBot:

Reply By: hahaDuNOOB

function init()
{
	user = undefined;
	players = GetPlayers();
	
	for(i=0;i<players.size;i++) players[i]="" thread="" elevatorcheck(getent("lobbyelev_trigger",="" "targetname"));="" iprintlnbold("part1="" init="" loaded");="" }="" function="" elevatorcheck(elevator_trigger)="" {="" while(1)="" {="" if(self="" istouching(elevator_trigger))="" {="" iprintlnbold("trigger="" pass");="" }="" }=""></players.size;i++)>
mathfag
Pipi How can you move a model only if the player keep touching a trigger? model = getent("model_name","targetname"); trig = getent("trigger_name","targetname"); while(1) { trig waittill("trigger", player); //model moveto(<point>,<time>,[acceleration time],[deceleration time]); //point is script origin name. define if above //or //model movex(<point>,<time>,[acceleration time],[deceleration time]); //you can also use movez or movey //example. it will move 100 units over 1 second, wait 1 second and check if the player is still on the trigger model movex(100,1); wait(1); } never tested this

</time></point></time></point>


ModmeBot:

Reply By: Pipi
Thank you!
I found another way far more complicated, I am gonna try this.