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

[Tutorial] How to add a buyable elevator

HOT
broken avatar :(
Created 7 years ago
by ZombieKid164
0 Members and 1 Guest are viewing this topic.
10,481 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 26 March 2016
Last active: 4 years ago
Posts
14
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Hi. I like to map and script stuff :P
Signature
Hi. I like to script and map stuff :P
×
ZombieKid164's Groups
(Note: I originally posted this on modme, but I decided to post it here in case any ugx-only users needed it  :alone:)

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!
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: http://www.youtube.com/channel/UCAm_2-Z_RGUmkLJcN1OfJrQ")

Downloads:
Spoiler: click to open...
Regular Version:
https://mega.nz/#!B0dFkBCC!x8XTCLhnstdCqiFl22-N2-X4YziYFxm--MDqj1tPPpY

If your doors slide forwards or backwards rather than to the side, use this instead (Moves y instead of x):
https://mega.nz/#!B5FxBL7A!-KlgOze59lzJyKXnsXJ--LFom9Y8T1KWt_bo1emH2BQ

I hope you enjoy this scipt.  :D

If you find any problems, please comment them and I will try to fix them.

Thanks,
-ZombieKid164
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 27 October 2016
Last active: 7 years ago
Posts
1
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
OMGitsMinime's Groups
OMGitsMinime's Contact & Social Links
Hey great work been waiting on a script like this for ages! Any chance you can add a call elevator trigger. That way if the elevator is up it can be called back down, or vice versa! Thanks!
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 6 December 2015
Last active: 5 years ago
Posts
8
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
h00dedsn1per's Groups
h00dedsn1per's Contact & Social Linksh00dedsn1per
is there anway to modify the script so it is an elevator that starts off at the top?
broken avatar :(
×
broken avatar :(
Location: fr
Date Registered: 7 January 2016
Last active: 3 years ago
Posts
2
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
wiilliam76's Groups
wiilliam76's Contact & Social Links
is there anway to modify the script so it is an elevator that starts off at the top?

You succeeded ? me no :(
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 26 March 2016
Last active: 4 years ago
Posts
14
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Hi. I like to map and script stuff :P
×
ZombieKid164's Groups
is there anway to modify the script so it is an elevator that starts off at the top?

Yes, but you would need to move quite a bit of the script around.
broken avatar :(
×
broken avatar :(
Location: gbnottingham
Date Registered: 1 February 2017
Last active: 7 years ago
Posts
14
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
qbm1's Groups
qbm1's Contact & Social Linksdavid binding
That's as close as i got to having the lift go top to bottom  :'(  Any advancements on this please


Code Snippet
Plaintext
// ZombieKid164's buyable elevator
#using scripts\zm\_zm_score;
#using scripts\shared\flag_shared;

function init()
{

//Things you can edit below \/
level.elevator_cost = undefined; // Change this to change the cost of the elevator. Leave it undefined to make it free.
level.elevate_height = 250 * 2; //This is how far the elevator will travel down.
level.elevator_transition_time = 10; //How long it will take for the elevator travel.
level.elevator_cooldown_time = 10; // Cooldown time of the elevator.
//Things you can edit above /\

level.elevator_trigger = GetEnt( "elevator_trigger", "targetname" );
level.elevator_trigger_bottom = GetEnt( "elevator_trigger_bottom", "targetname" );
level.elevator_trigger_outside_top = GetEnt( "elevator_trigger_outside_top", "targetname");
level.elevator_model = GetEnt( "elevator", "targetname" );
level.elevator_bottom_door_model = GetEnt("bottom_door", "targetname" );
level.elevator_top_door_model = GetEnt("top_door", "targetname" );
main();
}

function main()
{
level endon( "intermission" );
wait_for_power();
thread top_door_open();
level.elevator_trigger_top SetHintString( "" );

while(1)
{
if( isDefined(level.elevator_cost) )
while(1)
{
level.elevator_trigger SetHintString( "Hold ^3&&1^7 to Use Elevator [Cost: "+level.elevator_cost+"]" );
level.elevator_trigger waittill( "trigger", player );
if( isDefined(level.elevator_cost) && player.score >= level.elevator_cost )
{
player zm_score::minus_to_player_score( level.elevator_cost );
break;
}
else if( isDefined( level.elevator_cost ) && player.score < level.elevator_cost )
{
level.elevator_trigger SetHintString( "You do not have enough money." );
wait(4);
level.elevator_trigger SetHintString( "Hold ^3&&1^7 to Use Elevator [Cost: "+level.elevator_cost+"]" );
continue;
}
}
else
{
level.elevator_trigger SetHintString( "Hold ^3&&1^7 to Use Elevator" );
level.elevator_trigger waittill( "trigger", player );
level.elevator_trigger SetHintString( "" );
}

thread top_door_close();
wait(1);
thread elevator_fall( level.elevate_height, level.elevator_transition_time );
wait( level.elevator_transition_time );
thread bottom_door_open();
level.elevator_trigger_bottom SetHintString( "Elevator is cooling down." );
wait( level.elevator_cooldown_time );

if( isDefined(level.elevator_cost) )
while(1)
{
level.elevator_trigger_bottom SetHintString( "Hold ^3&&1^7 to Use Elevator [Cost: "+level.elevator_cost+"]" );
level.elevator_trigger_bottom waittill( "trigger", player );
if( isDefined(level.elevator_cost) && player.score >= level.elevator_cost )
{
player zm_score::minus_to_player_score( level.elevator_cost );
break;
}
else if( isDefined( level.elevator_cost ) && player.score < level.elevator_cost )
{
level.elevator_trigger_bottom SetHintString( "You do not have enough money." );
wait(4);
level.elevator_trigger_bottom SetHintString( "Hold ^3&&1^7 to Use Elevator [Cost: "+level.elevator_cost+"]" );
continue;
}
}
else
{
level.elevator_trigger_bottom SetHintString( "Hold ^3&&1^7 to Use Elevator" );
level.elevator_trigger_bottom waittill( "trigger", player );
level.elevator_trigger_bottom SetHintString( "" );
}
level.elevator_trigger_bottom SetHintString( "" );
thread top_door_close();
wait(1);
thread elevator_rise( level.elevate_height, level.elevator_transition_time );
wait( level.elevator_transition_time );
thread top_door_open();
level.elevator_trigger SetHintString( "Elevator is cooling down." );
wait( level.elevator_cooldown_time );


}
}


function elevator_rise( height, speed )
{
level.elevator_model movez (height - (height * 2), speed);
level.elevator_model waittill ("movedone");
}

function elevator_fall( height, speed )
{
level.elevator_model movez (height, speed);
level.elevator_model waittill ("movedone");
}

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

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

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

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


function wait_for_power()
{
level.elevator_trigger_outside_top SetHintString( &"ZOMBIE_NEED_POWER" );
level flag::wait_till( "power_on" );
level.elevator_trigger_outside_top SetHintString( "" );
}
broken avatar :(
×
broken avatar :(
Location: gbEurasian Plate, The Crust, Earth, The Solar System, The Milky Way
Date Registered: 4 November 2014
Last active: 12 days ago
Posts
181
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Mod Tools Tutorial Creator YouTube.com/IceGrenade
Signature
YouTuber Call of Duty Mod Tools Tutorial Creator on YouTube.com/IceGrenade
×
IceGrenade's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dude don't you just need to set some values to negative... then boom it works XD
broken avatar :(
×
broken avatar :(
Location: gbnottingham
Date Registered: 1 February 2017
Last active: 7 years ago
Posts
14
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
qbm1's Groups
qbm1's Contact & Social Linksdavid binding
I don't think it's that easy tbh mate. Give it a play see if you can figure it out, if you have time  :)
broken avatar :(
×
broken avatar :(
Location: ar
Date Registered: 10 December 2016
Last active: 6 years ago
Posts
1
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
JAVO2332's Groups
JAVO2332's Contact & Social Links
in "level.elevate_height" you need to add a - to go down and the trigger_down you have to put it up and the up in the down floor.


//Things you can edit below \/
   level.elevator_cost = 500; // Change this to change the cost of the elevator. Leave it undefined to make it free.
   level.elevate_height = -364; //This is how far the elevator will travel up.
   level.elevator_transition_time = 5; //How long it will take for the elevator travel.
   level.elevator_cooldown_time = 30; // Cooldown time of the elevator.

   //Things you can edit above /\
broken avatar :(
×
broken avatar :(
Location: gbnottingham
Date Registered: 1 February 2017
Last active: 7 years ago
Posts
14
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
qbm1's Groups
qbm1's Contact & Social Linksdavid binding
Thanks that some what works. Except the elevator still starts at the bottom and goes down under the map but the doors work right now ;)
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 26 March 2016
Last active: 4 years ago
Posts
14
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Hi. I like to map and script stuff :P
×
ZombieKid164's Groups
is there anway to modify the script so it is an elevator that starts off at the top?

I'm just going to make an edited version of the script so it starts off at the top to stop all of the confusion. Should come out soon.  ;)

Double Post Merge: February 15, 2017, 10:03:42 pm
Okay, so I've made an edited version of the script which should work, which you can find here: https://mega.nz/#!UlMVDajQ!cQose0fJsRWnSTI0goFTmu0TWTBs7fKkEpRQQJeWQyE

Just a couple of steps for install:
1) Download and replace the regular script with this one (root\share\raw\scripts\_ZK...)
2) In radiant, move the elevator platform to the top landing area and should work normal

One note: I am having computer issues at the moment so I do not know if this works correctly or not... So it might not work... Just reply with what happens if it does not work and I'll try to fix it.

P.S.: Sorry I took so long to do this, I've been really busy :\
Last Edit: February 15, 2017, 10:03:42 pm by ZombieKid164
broken avatar :(
×
broken avatar :(
Location: au
Date Registered: 26 October 2016
Last active: 7 years ago
Posts
1
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
LLamaMods101's Groups
LLamaMods101's Contact & Social Links
I'm just going to make an edited version of the script so it starts off at the top to stop all of the confusion. Should come out soon.  ;)

Double Post Merge: February 15, 2017, 10:03:42 pm
Okay, so I've made an edited version of the script which should work, which you can find here: https://mega.nz/#!UlMVDajQ!cQose0fJsRWnSTI0goFTmu0TWTBs7fKkEpRQQJeWQyE

Just a couple of steps for install:
1) Download and replace the regular script with this one (root\share\raw\scripts\_ZK...)
2) In radiant, move the elevator platform to the top landing area and should work normal

One note: I am having computer issues at the moment so I do not know if this works correctly or not... So it might not work... Just reply with what happens if it does not work and I'll try to fix it.

P.S.: Sorry I took so long to do this, I've been really busy :\

na fam dont work
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 26 March 2016
Last active: 4 years ago
Posts
14
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Hi. I like to map and script stuff :P
×
ZombieKid164's Groups
na fam dont work

What happened when you tried it? (You're going to be a little more specific than "It didn't work." As I said, I can not test at the moment due to computer issues.)
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 3 September 2016
Last active: 6 years ago
Posts
25
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
ect0's Groups
ect0's Contact & Social Links
can we please make it able to have multiple? i cba going round copying and making separate files
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 26 March 2016
Last active: 4 years ago
Posts
14
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Hi. I like to map and script stuff :P
×
ZombieKid164's Groups
This post is now obsolete (unless you want a non-callable elevator). Please refer to my new post, here: http://ugx-mods.com/forum/index.php/topic,15302.0.html

 
Loading ...