Modme Forums
Menu:

[Tutorial] Buyable Elevator

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


ModmeBot:

Thread By: ZombieKid164

Preview Video: Hello fellow modders! A lot of people have been asking for an elevator script, and I needed one, so I created one. In this script (which you see in the video) you must turn on the power, then buy the elevator, and it has sliding doors that close while the elevator is moving! Since I am fairly new to scripting, this took about two days to get working right. All the things you will need are in the download. The instructions are also in the download. IMPORTANT: Please DO NOT re-upload this script. If you are going to use this in your map or video, please credit me. (Ex: "ZombieKid164 - Youtube: https://www.youtube.com/channel/UCAm_2-Z_RGUmkLJcN1OfJrQ")



Downloads: Regular Version: <download data-url="https://mega.nz/#!B0dFkBCC!x8XTCLhnstdCqiFl22-N2-X4YziYFxm--MDqj1tPPpY"></download> If your doors slides forwards or backwards rather than to the side, use this instead (Moves y instead of x): <download data-url="https://mega.nz/#!B5FxBL7A!-KlgOze59lzJyKXnsXJ--LFom9Y8T1KWt_bo1emH2BQ"></download> I hope you enjoy this scipt. If you find any problems, please comment them and I will try to fix them. Thanks, -ZombieKid164


ModmeBot:

Reply By: Blink-420
Just what I needed :D Trying it out now, thanks!


ModmeBot:

Reply By: ZombieKid164

Blink-420Just what I needed :D Trying it out now, thanks!


You're welcome! If you find any problems or need help, just ask.


ModmeBot:

Reply By: Blink-420

ZombieKid164
Blink-420Just what I needed :D Trying it out now, thanks!


You're welcome! If you find any problems or need help, just ask.


Works flawlessly, stamped prefab, resized some stuff and added textures, love it! One suggestion, or request I should say, would be to add a call feature where you can call the elevator if its not on the same floor, such as "five" zombies from black ops 1, would be awesome!


ModmeBot:

Reply By: snprym
Does not work for me. After I pay for the elevator, the door closes but the brush stays on the ground. After a few seconds the door above me opens. Could you help me?


ModmeBot:

Reply By: ZombieKid164

Blink-420
ZombieKid164
Blink-420Just what I needed :D Trying it out now, thanks!


You're welcome! If you find any problems or need help, just ask.


Works flawlessly, stamped prefab, resized some stuff and added textures, love it! One suggestion, or request I should say, would be to add a call feature where you can call the elevator if its not on the same floor, such as "five" zombies from black ops 1, would be awesome!


I'm currently working on a new script, containing the call feature, which I will release soon.


ModmeBot:

Reply By: ZombieKid164

snprymDoes not work for me. After I pay for the elevator, the door closes but the brush stays on the ground. After a few seconds the door above me opens. Could you help me?


Did you edit anything in the zk_buyable_elevator.gsc? You may have accidentally added something that broke the script... I would try re-downloading the package, carefully changing what you need to in the .gsc, and then pasting the new files over the older ones. If you did not change anything in the .gsc, then try re-installing the package.


ModmeBot:

Reply By: m1cke
Just gonna infrom you zombiekid but both scripts the doors moves backward and fowards!


ModmeBot:

Reply By: ZombieKid164

m1ckeJust gonna infrom you zombiekid but both scripts the doors moves backward and fowards!


Did you actually replace the regular script? It's not that one tells the door to move forwards or backwards, one tells it to move in the x value, and the alternative tells it to move the y value, so it varies based on which way the elevator is facing. for example, when I first made the script, I told it to move the x, and the door came away from my elevator... so I kept that script as a the alternative and made a different one that moved the y instead of the x, which is shown in the video.


ModmeBot:

Reply By: natesmithzombies

ZombieKid164
m1ckeJust gonna infrom you zombiekid but both scripts the doors moves backward and fowards!


Did you actually replace the regular script? It's not that one tells the door to move forwards or backwards, one tells it to move in the x value, and the alternative tells it to move the y value, so it varies based on which way the elevator is facing. for example, when I first made the script, I told it to move the x, and the door came away from my elevator... so I kept that script as a the alternative and made a different one that moved the y instead of the x, which is shown in the video.


I recommend that you use the function AnglesToForward and AnglesToRight in the future. I needed to use these to orient the placement of my headchopper and tramplesteam in my buildables. It is not too hard to understand once you get it down. If you care to see an example drop me a PM


ModmeBot:

Reply By: ZombieKid164

natesmithzombies
ZombieKid164
m1ckeJust gonna infrom you zombiekid but both scripts the doors moves backward and fowards!


Did you actually replace the regular script? It's not that one tells the door to move forwards or backwards, one tells it to move in the x value, and the alternative tells it to move the y value, so it varies based on which way the elevator is facing. for example, when I first made the script, I told it to move the x, and the door came away from my elevator... so I kept that script as a the alternative and made a different one that moved the y instead of the x, which is shown in the video.


I recommend that you use the function AnglesToForward and AnglesToRight in the future. I needed to use these to orient the placement of my headchopper and tramplesteam in my buildables. It is not too hard to understand once you get it down. If you care to see an example drop me a PM


How would you go along to doing this? As I said in the post, I'm fairly new to scripting... sorry if that seems like a dumb question.


ModmeBot:

Reply By: natesmithzombies

ZombieKid164
natesmithzombies
ZombieKid164
m1ckeJust gonna infrom you zombiekid but both scripts the doors moves backward and fowards!


Did you actually replace the regular script? It's not that one tells the door to move forwards or backwards, one tells it to move in the x value, and the alternative tells it to move the y value, so it varies based on which way the elevator is facing. for example, when I first made the script, I told it to move the x, and the door came away from my elevator... so I kept that script as a the alternative and made a different one that moved the y instead of the x, which is shown in the video.


I recommend that you use the function AnglesToForward and AnglesToRight in the future. I needed to use these to orient the placement of my headchopper and tramplesteam in my buildables. It is not too hard to understand once you get it down. If you care to see an example drop me a PM


How would you go along to doing this? As I said in the post, I'm fairly new to scripting... sorry if that seems like a dumb question.


It's not a dumb question at all. Most experienced scripters don't know how to do it. I will send you PM tomorrow I just left for some more traveling for the remainder of the day and I'm on a cell right now and can't write it out


ModmeBot:

Reply By: m1cke

natesmithzombies
ZombieKid164
natesmithzombies
ZombieKid164
m1ckeJust gonna infrom you zombiekid but both scripts the doors moves backward and fowards!


Did you actually replace the regular script? It's not that one tells the door to move forwards or backwards, one tells it to move in the x value, and the alternative tells it to move the y value, so it varies based on which way the elevator is facing. for example, when I first made the script, I told it to move the x, and the door came away from my elevator... so I kept that script as a the alternative and made a different one that moved the y instead of the x, which is shown in the video.


I recommend that you use the function AnglesToForward and AnglesToRight in the future. I needed to use these to orient the placement of my headchopper and tramplesteam in my buildables. It is not too hard to understand once you get it down. If you care to see an example drop me a PM


How would you go along to doing this? As I said in the post, I'm fairly new to scripting... sorry if that seems like a dumb question.


It's not a dumb question at all. Most experienced scripters don't know how to do it. I will send you PM tomorrow I just left for some more traveling for the remainder of the day and I'm on a cell right now and can't write it out


zombiekid is it possible to remove so that when the elevator has coolendown it goes back up again automatticly and then the player can use the trigger again i use the hight - so it goes down eny ide?


ModmeBot:

Reply By: ZombieKid164

m1ckezombiekid is it possible to remove so that when the elevator has coolendown it goes back up again automatticly and then the player can use the trigger again i use the hight - so it goes down eny ide?


I do not understand what you are saying; what is it you want removed?


ModmeBot:

Reply By: m1cke

ZombieKid164
m1ckezombiekid is it possible to remove so that when the elevator has coolendown it goes back up again automatticly and then the player can use the trigger again i use the hight - so it goes down eny ide?


I do not understand what you are saying; what is it you want removed?


I edited the height to - so it would send me down "like five" but when the elevator reaches that height it takes like 20 sec then it goes back up again can't it just stay down there?

also when ur in the elevator zombies can't attack you


ModmeBot:

Reply By: m1cke

ZombieKid164
m1ckezombiekid is it possible to remove so that when the elevator has coolendown it goes back up again automatticly and then the player can use the trigger again i use the hight - so it goes down eny ide?


I do not understand what you are saying; what is it you want removed?




Why can't zombies attack you in the elevator?


ModmeBot:

Reply By: ZombieKid164

m1cke



Why can't zombies attack you in the elevator?


I am going to update the script soon with some fixes to people's problems.


ModmeBot:

Reply By: Spirit I eagle
hey can it go on the Length ?


ModmeBot:

Reply By: xXxmappermanxXx

Thanks for the script! When I am publishing a map, that uses this elevator script, to the workshop - do people need to also download these files and put them in their directories - or will the elevator work just as it should with out the player having to do anything else other than subscribing to the mod?


ModmeBot:

Reply By: DTZxPorter

Download links fixed, note: please use the download button in the new editor! It properly formats a download.


ModmeBot:

Reply By: Abnormal202

Nice function. May I recommend adding a little life with some sounds?

By chaning these functions to this:

function elevator_rise( height, speed )
{
	level.elevator_model PlaySound("elevator_music");
	level.elevator_model PlayLoopSound("mechanical_whirring");
	level.elevator_model movez (height, speed);
	level.elevator_model waittill ("movedone");
	level.elevator_model StopSound("elevator_music");
	level.elevator_model StopSound("mechanical_whirring");
}

function elevator_fall( height, speed )
{
	level.elevator_model PlaySound("elevator_music");
	level.elevator_model PlayLoopSound("mechanical_whirring");
	level.elevator_model movez (height - (height * 2), speed);
	level.elevator_model waittill ("movedone");
	level.elevator_model StopSound("elevator_music");
	level.elevator_model StopSound("mechanical_whirring");
}

function bottom_door_open()
{
	level.elevator_bottom_door_model PlaySound("ding");
	level.elevator_bottom_door_model movex (130, 1);
}

function bottom_door_close()
{
	level.elevator_bottom_door_model PlaySound("door_close");
	level.elevator_bottom_door_model movex (130 - (130 * 2), 1);
}

function top_door_open()
{
	level.elevator_top_door_model PlaySound("ding");
	level.elevator_top_door_model movex (130, 1);
}

function top_door_close()
{
	level.elevator_top_door_model PlaySound("door_close");
	level.elevator_top_door_model movex (130 - (130 * 2), 1);
}



You can play sounds whenever a door closes or opens, when the elevator is traveling, as well as some groovy elevator tunes.

Just a suggestion, obviously everyone would have to get the sounds themselves, but they could rip most of it from Die Rise.


ModmeBot:

Reply By: ZombieKid164

Abnormal202

You can play sounds whenever a door closes or opens, when the elevator is traveling, as well as some groovy elevator tunes.

Just a suggestion, obviously everyone would have to get the sounds themselves, but they could rip most of it from Die Rise.

I know I could have added sounds, but sadly, I do not own BO2 for PC, so I cannot get the sounds.


ModmeBot:

Reply By: Abnormal202

ZombieKid164
Abnormal202

You can play sounds whenever a door closes or opens, when the elevator is traveling, as well as some groovy elevator tunes.

Just a suggestion, obviously everyone would have to get the sounds themselves, but they could rip most of it from Die Rise.

I know I could have added sounds, but sadly, I do not own BO2 for PC, so I cannot get the sounds.

Here are the elevator as well as trample Steam sounds (they could both work): <download data-url="https://mega.nz/#!yphFgbbQ!leE-LnNp5DmO-O1yu3Poz8IgAw9tb3bQ_K81JHuDxD8"></download>


ModmeBot:

Reply By: themotogamer115

is there anyway of calling the elevator up from the top if its at the bottom?


ModmeBot:

Reply By: greatbrendini

ZombieKid164
Blink-420ZombieKid164Blink-420Just what I needed :D Trying it out now, thanks! You're welcome! If you find any problems or need help, just ask. Works flawlessly, stamped prefab, resized some stuff and added textures, love it! One suggestion, or request I should say, would be to add a call feature where you can call the elevator if its not on the same floor, such as "five" zombies from black ops 1, would be awesome! I'm currently working on a new script, containing the call feature, which I will release soon.

is the new script anywhere near done? because i REALLY need to have the call button, otherwise i can't even use the elevator at all


ModmeBot:

Reply By: truman08
The Zombies will not attack whilst the player is standing inside the elevator. Did this issue get fixed? I have version 2 but I'm still getting the problem.


jako1988:

hey,
rondom question:
if i want my elevator(the rising parts) to have multiple brushes,
do i need to name every part diff. and add every part in the code or,
can i link them somehow, tried the prefab but does not work,it does not move when i have multiple things called the same,
and when i makethe parts first and prefab,and then put a script brush on it my prefab changes in a big white brush.
any suggestions?

many thnks in advance


mrlednor:

Reply By: Abnormal202
Nice function. May I recommend adding a little life with some sounds?
By chaning these functions to this:
function elevator_rise( height, speed )
{
    level.elevator_model PlaySound("elevator_music");
    level.elevator_model PlayLoopSound("mechanical_whirring");
    level.elevator_model movez (height, speed);
    level.elevator_model waittill ("movedone");
    level.elevator_model StopSound("elevator_music");
    level.elevator_model StopSound("mechanical_whirring");
}

function elevator_fall( height, speed )
{
    level.elevator_model PlaySound("elevator_music");
    level.elevator_model PlayLoopSound("mechanical_whirring");
    level.elevator_model movez (height - (height * 2), speed);
    level.elevator_model waittill ("movedone");
    level.elevator_model StopSound("elevator_music");
    level.elevator_model StopSound("mechanical_whirring");
}

function bottom_door_open()
{
    level.elevator_bottom_door_model PlaySound("ding");
    level.elevator_bottom_door_model movex (130, 1);
}

function bottom_door_close()
{
    level.elevator_bottom_door_model PlaySound("door_close");
    level.elevator_bottom_door_model movex (130 - (130 * 2), 1);
}

function top_door_open()
{
    level.elevator_top_door_model PlaySound("ding");
    level.elevator_top_door_model movex (130, 1);
}

function top_door_close()
{
    level.elevator_top_door_model PlaySound("door_close");
    level.elevator_top_door_model movex (130 - (130 * 2), 1);
}



You can play sounds whenever a door closes or opens, when the elevator is traveling, as well as some groovy elevator tunes.
Just a suggestion, obviously everyone would have to get the sounds themselves, but they could rip most of it from Die Rise.

i have the sounds from die rise and ur added lines to a script do i make a sound allies or just add them in sound_assets ?