UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: Chunkdogg9 on April 03, 2014, 03:37:51 am

Title: Die rise elevator help!
Post by: Chunkdogg9 on April 03, 2014, 03:37:51 am
Would someone like to help me out with a script that makes my elevator go up and down without buttons like in die rise.

So it goes down and up every minute and half?

Thank you

- Chunkdogg9
Title: Re: Die rise elevator help!
Post by: jjbradman on April 03, 2014, 06:46:06 am
i havent tested this but try it lol xP
Code Snippet
Plaintext
#include common_scripts\utility; 
#include maps\_utility;
#include maps\_zombiemode_utility;

init() // keep in mind that the elevator starts in the up position in this script
{
level.elevator = getentarray("elevator", "targetname");
level. speed = 10; // how much time in secs you want it to take to get to the 200 units
level.height = -200; //how many units you want it to move
thread elevator_think();
}

elevator_think()
{
thread go_down();
wait 60;
thread go_up();
wait 60;
thread elevator_think();
}

go_down();
{
for( i = 0; i < level.elevator.size; i++ )
{
level.elevator[i] movez (level.height, level.speed);
         }
}

go_up()
{
for( i = 0; i < level.elevator.size; i++ )
{
level.elevator movez (level.height - (level.height * 2), level.speed);
         }
}
Title: Re: Die rise elevator help!
Post by: Chunkdogg9 on April 03, 2014, 07:50:24 am
Thanks now I gotta figure out how to get get it to all work..
Title: Re: Die rise elevator help!
Post by: Ege115 on April 03, 2014, 03:19:42 pm
And you also have to link the perk machines to the elevators so they move with the elevator.
Place the perks in the elevators.
Give the whole perk machine prefabs in radiant this KVP,
Code Snippet
Plaintext
targetname - perk
And let this small script do the job for you, if it works ;) (untested)

Code Snippet
Plaintext
perk = GetEntArray ("perk", "targetname");

for( i = 0; i < perk.size; i++ )
{
perk[i] enablelinkto();
perk[i] linkto ("elevator");
}

Edit: Well if you are going to have the perks in the elevator as well, but just in case ;).