Posts
159
Respect
55Add +1
Forum Rank
Pack-a-Puncher
Primary Group
Member
Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!
lift()
{
lift = getEnt("lift", "targetname");
trig = getEnt("trigg", "targetname");
trig SetCursorHint( "HINT_NOICON" );
trig UseTriggerRequireLookAt();
trig setHintString("Press ^2[&&1] ^6to move lift");
//false == down, true == up
lift_is = false;
for (;;)
{
trig waittill("trigger");
if (lift_is == false)
{
lift MoveZ (176, 4);
lift_is = true;
wait 5;
}
if (lift_is == true)
{
lift MoveZ (-176, 4);
lift_is = false;
wait 5;
}
}
wait 0.5;
}
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() | |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown excellence and experience in the area of custom scripting in the UGX-Mods community. |
![]() BO3 Modtools Alpha | This user has access to the Black Ops 3 Modtools Alpha |
What kind of trigger did you use?
and did you give it tagetname "trigg" or "trig"?
?![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
If the trigger was undefined it wouldn't work would it now?
Anyway the trigger isn't a trigger_use so either add a few validation checks such as UseButtonPressed() and other shit.
So, do use either method for it.

if (lift_is == false)
{
lift MoveZ (176, 4);
lift_is = true;
wait 5;
}
else if (lift_is == true) // else if - or could use just "else"
{
lift MoveZ (-176, 4);
lift_is = false;
wait 5;
}![]() | Has released one or more maps to the UGX-Mods community. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() BO3 Modtools Alpha | This user has access to the Black Ops 3 Modtools Alpha |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |


![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
Thanks, I'll try what you guys said and will be back here if needed

![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
I had 2 triggers with the same targename, one on the first floor and another one on the second floor, maybe that was causing the problem, but anyway, its working, thanks!
[srry for bad english :v]

![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
I had 2 triggers with the same targename, one on the first floor and another one on the second floor, maybe that was causing the problem, but anyway, its working, thanks!
[srry for bad english :v]
![]() | |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown excellence and experience in the area of custom scripting in the UGX-Mods community. |
![]() BO3 Modtools Alpha | This user has access to the Black Ops 3 Modtools Alpha |
Since you had 2 triggers with same targetname, you would have to use getentarray instead of getent. getent is only for 1 trig with a certain targetname, getentarray is for more than one. For something like this I would recommend what makecents said.

lift()
{
trig = getEntArray("trigger", "targetname");
for (i=0;i<trig.size;i++)
{
trig[i] thread trigs_think();
}
//false == down, true == up
level.lift_is = false;
level.lift_moving = false;
}
trigs_think()
{
lift = getEnt("lift", "targetname");
self SetCursorHint( "HINT_NOICON" );
self UseTriggerRequireLookAt();
self setHintString("Press ^3[&&1] ^7to move lift");
for (;;)
{
self waittill("trigger");
if (level.lift_is == false && level.lift_moving == false)
{
level.lift_moving = true;
lift MoveZ (128, 4);
level.lift_is = true;
wait 5;
level.lift_moving = false;
}
else if (level.lift_is == true && level.lift_moving == false)
{
level.lift_moving = true;
lift MoveZ (-128, 4);
level.lift_is = false;
wait 5;
level.lift_moving = false;
}
wait 0.5;
}
}