Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define SHOT_FX "electric/fx_elec_gp_wire_sparking_xsml_thick_anim"
- #precache( "fx", SHOT_FX );
- // add the above underneath the #using statements at the top of your mapname.gsc
- function shootable_trigs()
- {
- level.shootable_door_count = 0;
- trigs = GetEntArray( "shootable_door", "targetname" );
- level.shootable_door_goal = trigs.size;
- foreach( trig in trigs )
- trig thread wait_for_shoot();
- }
- function wait_for_shoot()
- {
- self waittill( "trigger", player );
- player PlayLocalSound( "zmb_cha_ching" ); // Change this to any sound alias you want
- model = GetEnt( self.target, "targetname" );
- PlayFx( SHOT_FX, model.origin );
- waiti(0.05);
- model delete();
- level.shootable_door_count++;
- if( level.shootable_door_count == level.shootable_door_goal )
- self open_door();
- }
- function open_door()
- {
- doors = GetEntArray( "shootable_door_reward", "targetname" );
- foreach( door in doors )
- door PlaySound( "zmb_cha_ching" );
- wait(0.05);
- foreach( door in doors )
- door delete();
- flag = doors[0].script_flag;
- level flag::set( flag );
- }
- 2) At the top of your mapname.gsc add the following code
Advertisement
Add Comment
Please, Sign In to add comment