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] Players "deposit" points to open a door. Will scale to players size

broken avatar :(
Created 9 years ago
by Dust
0 Members and 1 Guest are viewing this topic.
3,207 views
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Donate to me if you enjoy my work. https://www.paypal.me/thezombiekilla6
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
PURPOSE:
This is a simple tutorial that will add a door so the players can deposit points to it to open it, and you can also change it to have it cost more depending on how many players are in the map. This is the script I made for Undead Overkill, map by PCModder.

SCRIPT:
1. Open up your mapname.gsc, towards the middle of the file, you will see
Code Snippet
Plaintext
maps\_zombiemode::main();
UNDER it paste this in
Code Snippet
Plaintext
thread deposit_door();

2. At the bottom of the file, paste this into it

Code Snippet
Plaintext
door()
{
level.deposited_points = 0; //this will go up as the players deposit the points
level.amount_required = 1000; //this will be how much the players need to get if playing solo
players = get_players();
if(players.size == 2) //if 2 players are in the map
{
level.amount_required = 2000; //Change this to how much you want it to be for 2 players
}
if(players.size == 3) //if 3 players are in the map
{
level.amount_required = 3000; //Change this to how much you want it to be for 3 players
}
if(players.size == 4) //if 4 players are in the map
{
level.amount_required = 4000; //Change this to how much you want it to be for 4 players
}
level.deposit = 1000; //this is how much the players deposit at a time
door = getent("door","targetname"); //door in radiant
door_clip = getent("door_clip","targetname"); //clip around door in radiant
door_trig = getent("door_trig","targetname"); //trigger in radiant
door_trig SetCursorHint("HINT_NOICON"); //Getting rid of hand symbol
door_trig SetHintString("Press &&1 to deposit "+level.deposit+ " points, Total Cost: " +level.amount_required); //hint string that the players will see, feel free to change it
while(1) //while loop so players can activate it more than once
{
wait 0.1;
door_trig waittill("trigger",player);
if(player.score >= level.deposit)
{
player maps\_zombiemode_score::minus_to_player_score( level.deposit );
level.deposited_points = level.deposited_points + level.deposit;
iprintlnbold("You have deposited " +level.deposited_points+ " out of " +level.amount_required);

if(level.deposited_points >= level.amount_required)
{
door_trig delete();
door_clip delete();
door delete();
door connectpaths();
flag_set("enter_zone1"); //change this to whatever your zone is called
}
}
}
}

You will see some variables at the top.
Only thing you should worry about is the
Code Snippet
Plaintext
level.amount_required
. That is where you will put how many points the players need to deposit to open the door. I left some comments in so you know which one to change to make it for solo,2 player, 3 player, or 4 player.
You can also change the
Code Snippet
Plaintext
level.deposit
if you want. That is how much the players can deposit at 1 time, default is 1000 points.
Code Snippet
Plaintext
flag_set("enter_zone1");
That is the name of the flag for the zone you are entering, it is set up the same way as a normal zone, so make sure it matches the zone that you are entering.

RADIANT:

1. Make a new door in radiant, make sure its a script_brushmodel. Give it the KVP: Key: targetname, Value: door. Make sure Dynamic Path is checked!
2. Make a clip that is also a script_brushmodel, give it the KVP: Key: targetname, Value:door_clip. Make sure dynamic path is checked!
3. Make a trigger_use around the door, give it the KVP: Key, targetname, Value:door_trig

FINAL:
Compile map, and build mod and your done!
Please give me credit if you use this script
If you have any questions, don't hesitate to ask
broken avatar :(
×
broken avatar :(
Location: 00
Date Registered: 20 June 2014
Last active: 11 days ago
Posts
768
Respect
Forum Rank
The Decider
Primary Group
Member
Personal Quote
Behold the power of Mirror Force
Signature
The greatest failure is not to try and fail, but is to fail without trying.
×
Ramiabdh's Groups
Ramiabdh's Contact & Social Links
Awesome tut man. :D This will bring about some cool challenges.
broken avatar :(
×
broken avatar :(
Location: gbNewport
Date Registered: 2 November 2014
Last active: 2 years ago
Posts
1,265
Respect
Forum Rank
Zombie Colossus
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Embrace the Darkness
×
Tim Smith's Groups
Tim Smith's Contact & Social Linkstimsmith90THEREALBaDBoY17TimSmithMy clan Website
good work :D i surely find a use of this
broken avatar :(
×
broken avatar :(
Location: es
Date Registered: 25 May 2016
Last active: 4 years ago
Posts
98
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
kitos's Groups
kitos's Contact & Social Links
this is with souls to open door? or only is deposit point to open? im searching how to do deposit to open the trigger but not with points with zombie souls like this video:

http://www.youtube.com/watch?v=Gs5TxKedWuU

the souls go to the door and when they take souls the door is open can you help me? please?
Last Edit: August 05, 2017, 09:18:41 am by kitos

 
Loading ...