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

[script] simplified power switch

broken avatar :(
Created 10 years ago
by daedra descent
0 Members and 1 Guest are viewing this topic.
1,122 views
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
A "simplified" version of your standard power switch. This "simplified" version allows for easy control over what gets turned on when you use the trigger (for example, if i only wanted the pack-a-punch machine on and not anything else) This can also be used to replicate Shangri-la's power switches where you need to activate both to turn on the power, or even require you to flip multiple switches to activate the power.

As a fair warning, You will need to copy/paste/edit each function for EACH power switch in your map, otherwise some of the visual affects won't work, aswell as modify the KVP's of the power switch prefab as needed. Also you NEED to have the original power switch somewhere in your map, doesn't matter where, you just need it. So yeah, you need to have average level script know-how to use this.

Code Snippet
Plaintext
power_switch_1()
{
//Used for setting the notify's for the perk machines aswell as the trigger,
//you will need to copy/paste this function for multiple switches.
//make sure to change the KVP info for each power switch if needed.
trig = getent("power_switch_1", "targetname");
trig.zombie_cost = 0;
trig sethintstring("Press & hold &&1 to turn perks on");

while(1)
{
trig waittill( "trigger", who );
{
if( is_player_valid( who ) )
{
if( who.score >= trig.zombie_cost )
{
level notify("juggernog_on");
level notify("sleight_on");
level notify("doubletap_on");
level notify( "Pack_A_Punch_on" );
level notify( "revive_on" );
level thread power_switch_init();
trig delete();
}
}
}
}
}
power_switch_visual_1()
{
// Makes the switch look normal, we NEED to run a seperate function on EACH switch that we use
//them
sub_switch_1 = getent("power_switch_lever","targetname");
sub_switch_1 notsolid();

sub_switch_1 rotateroll(-90,.3);
sub_switch_1 playsound("switch_flip");
playfx(level._effect["switch_sparks"] ,getstruct("power_switch_fx_1","targetname").origin);

ClientNotify( "pl1" ); // power lights on
exploder(600);
}
Last Edit: December 05, 2013, 12:06:36 am by daedra descent

 
Loading ...