UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

lift(Evalator)

broken avatar :(
Created 4 months ago
by Дмитрий78
0 Members and 1 Guest are viewing this topic.
115 views
broken avatar :(
×
broken avatar :(
Location: ru
Date Registered: 19 March 2021
Last active: 2 months ago
Posts
30
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
I took the script from this guide https://www.ugx-mods.com/forum/scripting/11/lift-problem/8861/msg96911#msg96911
 
but I wanted to add that the sounds of lifting and lowering the elevator would occur, also that it would be possible to buy lifting and lowering the elevator, how do I do this?
that is, add the price of the elevator, and the sounds when lifting and lowering the elevator
Code Snippet
Plaintext
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;
    }
}

Last Edit: December 23, 2023, 07:12:38 am by Дмитрий78

 
Loading ...