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

buildable script help

HOT
broken avatar :(
Created 10 years ago
by lordkurt6
0 Members and 2 Guests are viewing this topic.
4,582 views
broken avatar :(
×
broken avatar :(
Senpai
Location: us
Date Registered: 28 September 2013
Last active: 3 years ago
Posts
605
Respect
Forum Rank
Zombie Enslaver
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
arceus's Groups
Box Mappers Elite
Box Mappers Elite
arceus's Contact & Social LinksarceusNT
Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;
#include maps\_hud_util;

precache_test_script()
{
   PrecacheItem( "zombie_knuckle_crack" );
   precachemodel( "static_seelow_shovel" );
   precacheshader( "staff_part_hud");
}     

main()
{
   flag_init("staff_part_build");
   level thread staff_part_pickup();
   level thread staff_part_build();
   level thread staff_part_drop();
}

staff_part_pickup()
{
 while(1)
  {
   staff_part_trig = GetEnt("staff_part_pickup","targetname");
   haspart = undefined;
   staff_part_trig sethintstring( "Press &&1 to pick up staff part"  );
   staff_part_trig setCursorHint( "HINT_NOICON" );
   staff_part_trig UseTriggerRequireLookat();
   player = undefined;
   staff_part_model = getent("staff_part_model", "targetname"); // Pickup model
   staff_part_trig waittill("trigger", player);
   player thread staff_hud_create();
   flag_set( "staff_part_build" );
   player.haspart = true;
   playfx (level._effect["fx_fire_barrel_med"], self.origin);
   disable_trigger_with_targetname( staff_part_pickup );
  }
}

staff_part_build()
{
   build_trig = GetEnt("staff_part_build","targetname"); // Build trigger
   build_trig setCursorHint( "HINT_NOICON" );
   build_trig UseTriggerRequireLookat();
   staff_part_model = getent("staff_part_build", "targetname"); // Build Model
   staff_part_model hide();
   
   player = undefined;
   flag_wait( "staff_part_build" );
   build_trig sethintstring( "Press and hold &&1 to build staff part"  );
   
    while(1)                                                                              //////////////// Don Gooney's Hacker Function ////////////////
    {
build_trig waittill( "trigger" , player );
// if(user[i].haspart == true )
{
build_trig playsound( "soul_fly" );
timer = 0;
if(level.timedout)
{
hack_time = 2;
}
else
{
hack_time = 2;
}
Texthud = newClientHudElem(player);
Texthud.alignX = "center";
Texthud.alignY = "middle";
Texthud.horzAlign = "center";
Texthud.vertAlign = "bottom";
Texthud.y = -148;
Texthud.foreground = true;
Texthud.font = "default";
Texthud.fontScale = 1.8;
Texthud.alpha = 1;
Texthud.color = ( 1.0, 1.0, 1.0 );
Texthud setText( "BUILDING PART" );
ProgressBar = player createPrimaryProgressBar();                     //////////////// Don Gooney's Hacker Function ////////////////
ProgressBar updateBar( 0.01, 1 / hack_time );
ProgressBar.color = ( .5, 1, 1 );
while(player useButtonPressed())
{
wait 0.05;               
timer += 0.05;
                 
player thread do_knuckle_crack();
                 
if ( player maps\_laststand::player_is_in_laststand())
{
break;
}
if( timer >=  hack_time)
{
ProgressBar destroyElem();
                Texthud destroy();
playfx (level._effect["fx_fire_barrel_med"], staff_part_model.origin);
staff_part_model show();
build_trig playsound( "soul_fly" );
build_trig disable_trigger();
{
break;
}
}
}
}
ProgressBar destroyElem();
Texthud destroy();
    }
}

staff_part_drop()
{
    while(1)
    {
user = getplayers();
for( i = 0; i < user[i].size; i++ )
{
user[i] waittill_any( "fake_death", "death", "player_downed");
{
staff_model = getent("staff_part_model", "targetname"); // Pickup model
staff_model moveto (user[i].origin, 0.5);
staff_model show(); // forgot the ; here
user[i].haspart = false ;

staff_trig = GetEnt("staff_part_pickup","targetname"); // Pickup trigger
staff_trig moveto (user[i].origin, 0.5);
                                enable_trigger_with_targetname( staff_part_pickup );
{
break;
}

}
wait 0.05;
}
    }


staff_hud_create()
{
      hud = create_simple_hud( self );
      hud.foreground = true;
      hud.sort = 1;
      hud.hidewheninmenu = false;
      hud.alignX = "right";
      hud.alignY = "bottom";
      hud.horzAlign = "right";
      hud.vertAlign = "bottom";
      hud.x = hud.x + 2;
      hud.y = hud.y - 75;
      hud.alpha = 1;
      hud SetShader( "staff_part_hud" , 75, 40 );
}

do_knuckle_crack()
{
   self DisableOffhandWeapons();
   self DisableWeaponCycling();

   self AllowLean( false );
   self AllowAds( false );
   self AllowSprint( false );
   self AllowProne( false );     
   self AllowMelee( false );
   
   if ( self GetStance() == "prone" )
   {
      self SetStance( "crouch" );
   }

   gun = self GetCurrentWeapon();
   weapon = "zombie_knuckle_crack";   
   self GiveWeapon( weapon );
   self SwitchToWeapon( weapon );
   self waittill_any( "fake_death", "death", "player_downed", "weapon_change_complete" );
   self EnableOffhandWeapons();
   self EnableWeaponCycling();
   self GiveWeapon( gun );
   self SwitchToWeapon( gun );
   self AllowLean( true );
   self AllowAds( true );
   self AllowSprint( true );
   self AllowProne( true );     
   self AllowMelee( true );
   return gun;
}
lol lots of mistakes not sure if this one will work but i changed two things
broken avatar :(
×
broken avatar :(
Location: usUsa
Date Registered: 21 July 2013
Last active: 1 month ago
Posts
53
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
lordkurt6's Groups
lordkurt6's Contact & Social LinkstehfeedzPryZeWaRVii
yer them two things u done got an error
broken avatar :(
×
broken avatar :(
Senpai
Location: us
Date Registered: 28 September 2013
Last active: 3 years ago
Posts
605
Respect
Forum Rank
Zombie Enslaver
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
arceus's Groups
Box Mappers Elite
Box Mappers Elite
arceus's Contact & Social LinksarceusNT
ugh this is eritating


Double Post Merge: October 24, 2014, 09:59:14 pm
Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;
#include maps\_hud_util;

precache_test_script()
{
   PrecacheItem( "zombie_knuckle_crack" );
   precachemodel( "static_seelow_shovel" );
   precacheshader( "staff_part_hud");
}     

main()
{
   flag_init("staff_part_build");
   level thread staff_part_pickup();
   level thread staff_part_build();
   level thread staff_part_drop();
}

staff_part_pickup()
{
 while(1)
  {
   staff_part_trig = GetEnt("staff_part_pickup","targetname");
   haspart = undefined;
   staff_part_trig sethintstring( "Press &&1 to pick up staff part"  );
   staff_part_trig setCursorHint( "HINT_NOICON" );
   staff_part_trig UseTriggerRequireLookat();
   player = undefined;
   staff_part_model = getent("staff_part_model", "targetname"); // Pickup model
   staff_part_trig waittill("trigger", player);
   player thread staff_hud_create();
   flag_set( "staff_part_build" );
   player.haspart = true;
   playfx (level._effect["fx_fire_barrel_med"], self.origin);
   staff_part_trig disable();
  }
}

staff_part_build()
{
   build_trig = GetEnt("staff_part_build","targetname"); // Build trigger
   build_trig setCursorHint( "HINT_NOICON" );
   build_trig UseTriggerRequireLookat();
   staff_part_model = getent("staff_part_build", "targetname"); // Build Model
   staff_part_model hide();
   
   player = undefined;
   flag_wait( "staff_part_build" );
   build_trig sethintstring( "Press and hold &&1 to build staff part"  );
   
    while(1)                                                                              //////////////// Don Gooney's Hacker Function ////////////////
    {
build_trig waittill( "trigger" , player );
// if(user[i].haspart == true )
{
build_trig playsound( "soul_fly" );
timer = 0;
if(level.timedout)
{
hack_time = 2;
}
else
{
hack_time = 2;
}
Texthud = newClientHudElem(player);
Texthud.alignX = "center";
Texthud.alignY = "middle";
Texthud.horzAlign = "center";
Texthud.vertAlign = "bottom";
Texthud.y = -148;
Texthud.foreground = true;
Texthud.font = "default";
Texthud.fontScale = 1.8;
Texthud.alpha = 1;
Texthud.color = ( 1.0, 1.0, 1.0 );
Texthud setText( "BUILDING PART" );
ProgressBar = player createPrimaryProgressBar();                     //////////////// Don Gooney's Hacker Function ////////////////
ProgressBar updateBar( 0.01, 1 / hack_time );
ProgressBar.color = ( .5, 1, 1 );
while(player useButtonPressed())
{
wait 0.05;               
timer += 0.05;
                 
player thread do_knuckle_crack();
                 
if ( player maps\_laststand::player_is_in_laststand())
{
break;
}
if( timer >=  hack_time)
{
ProgressBar destroyElem();
                Texthud destroy();
playfx (level._effect["fx_fire_barrel_med"], staff_part_model.origin);
staff_part_model show();
build_trig playsound( "soul_fly" );
build_trig disable_trigger();
{
break;
}
}
}
}
ProgressBar destroyElem();
Texthud destroy();
    }
}

staff_part_drop()
{
    while(1)
    {
user = getplayers();
for( i = 0; i < user[i].size; i++ )
{
user[i] waittill_any( "fake_death", "death", "player_downed");
{
staff_model = getent("staff_part_model", "targetname"); // Pickup model
staff_model moveto (user[i].origin, 0.5);
staff_model show(); // forgot the ; here
user[i].haspart = false ;

staff_trig = GetEnt("staff_part_pickup","targetname"); // Pickup trigger
staff_trig moveto (user[i].origin, 0.5);
                                staff_trig enable();
{
break;
}

}
wait 0.05;
}
    }


staff_hud_create()
{
      hud = create_simple_hud( self );
      hud.foreground = true;
      hud.sort = 1;
      hud.hidewheninmenu = false;
      hud.alignX = "right";
      hud.alignY = "bottom";
      hud.horzAlign = "right";
      hud.vertAlign = "bottom";
      hud.x = hud.x + 2;
      hud.y = hud.y - 75;
      hud.alpha = 1;
      hud SetShader( "staff_part_hud" , 75, 40 );
}

do_knuckle_crack()
{
   self DisableOffhandWeapons();
   self DisableWeaponCycling();

   self AllowLean( false );
   self AllowAds( false );
   self AllowSprint( false );
   self AllowProne( false );     
   self AllowMelee( false );
   
   if ( self GetStance() == "prone" )
   {
      self SetStance( "crouch" );
   }

   gun = self GetCurrentWeapon();
   weapon = "zombie_knuckle_crack";   
   self GiveWeapon( weapon );
   self SwitchToWeapon( weapon );
   self waittill_any( "fake_death", "death", "player_downed", "weapon_change_complete" );
   self EnableOffhandWeapons();
   self EnableWeaponCycling();
   self GiveWeapon( gun );
   self SwitchToWeapon( gun );
   self AllowLean( true );
   self AllowAds( true );
   self AllowSprint( true );
   self AllowProne( true );     
   self AllowMelee( true );
   return gun;
}
if this doesn't work can you record what is happening?
Last Edit: October 24, 2014, 09:59:14 pm by arceus
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
You could try this one, it runs without error's but i didn't actually place the triggers etc to test any further.
Also have you thought about how you gonna add other parts to the script? Because this could work with one part, but adding others could be tricky without changing a lot..

Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;
#include maps\_hud_util;

precache_test_script()
{
   PrecacheItem( "zombie_knuckle_crack" );
   precachemodel( "static_seelow_shovel" );
   precacheshader( "staff_part_hud");
}     

main()
{
   flag_init("staff_part_build");
   level thread staff_part_pickup();
   level thread staff_part_build();
//   level thread staff_part_drop();
}

staff_part_pickup()
{
   staff_part_trig = GetEnt("staff_part_pickup","targetname");
   staff_part_trig setCursorHint( "HINT_NOICON" );
   staff_part_trig UseTriggerRequireLookat();
   staff_part_trig sethintstring( "Press &&1 to pick up staff part"  );

   staff_part_model = getent("staff_part_model", "targetname"); // Pickup model

player = undefined;
staff_part_trig waittill("trigger", player);
player thread staff_hud_create();
flag_set( "staff_part_build" );
player.haspart = true;
player thread staff_part_drop();
staff_part_model hide();
playfx (level._effect["fx_fire_barrel_med"], self.origin);
staff_part_trig disable_trigger();
}

staff_part_build()
{
   build_trig = GetEnt("staff_part_build","targetname"); // Build trigger
   build_trig setCursorHint( "HINT_NOICON" );
   build_trig UseTriggerRequireLookat();
   staff_part_model = getent("staff_part_build", "targetname"); // Build Model
   staff_part_model hide();
   
   player = undefined;
   build_trig sethintstring( "Parts required.."  );
   flag_wait( "staff_part_build" );
   build_trig sethintstring( "Press and hold &&1 to build staff part"  );
   
    while(1)                                                                              //////////////// Don Gooney's Hacker Function ////////////////
    {
ProgressBar = undefined;
Texthud = undefined;
build_trig waittill( "trigger" , player );
if( isdefined( player.haspart ) && player.haspart )
{
build_trig playsound( "soul_fly" );
timer = 0;
if(level.timedout)
{
hack_time = 2;
}
else
{
hack_time = 2;
}
Texthud = newClientHudElem(player);
Texthud.alignX = "center";
Texthud.alignY = "middle";
Texthud.horzAlign = "center";
Texthud.vertAlign = "bottom";
Texthud.y = -148;
Texthud.foreground = true;
Texthud.font = "default";
Texthud.fontScale = 1.8;
Texthud.alpha = 1;
Texthud.color = ( 1.0, 1.0, 1.0 );
Texthud setText( "BUILDING PART" );
ProgressBar = player createPrimaryProgressBar();                     //////////////// Don Gooney's Hacker Function ////////////////
ProgressBar updateBar( 0.01, 1 / hack_time );
ProgressBar.color = ( .5, 1, 1 );
player thread do_knuckle_crack();
while(player useButtonPressed())
{
wait 0.05;               
timer += 0.05;
                 
                 
if ( player maps\_laststand::player_is_in_laststand())
{
break;
}
if( timer >=  hack_time)
{
self notify( "staff_part_build" );
player.haspart = false;
if( isdefined( player.buildable_hud ) )
{
player.buildable_hud[ "staff" ] destroy_hud();
player.buildable_hud[ "staff" ] = undefined;
}
playfx (level._effect["fx_fire_barrel_med"], staff_part_model.origin);
staff_part_model show();
build_trig playsound( "soul_fly" );
build_trig disable_trigger();
break;
}
}
wait 0.1;
}
wait 0.1;
ProgressBar destroyElem();
Texthud destroy();
    }
}

staff_part_drop()
{
self endon( "staff_part_build" );

self waittill_any( "fake_death", "death", "player_downed" );

if( isdefined( self.buildable_hud ) )
{
self.buildable_hud[ "staff" ] destroy_hud();
self.buildable_hud[ "staff" ] = undefined;
}

staff_model = getent("staff_part_model", "targetname"); // Pickup model
staff_model show();
staff_model moveto (self.origin, 0.1);
self.haspart = false;

staff_trig = GetEnt("staff_part_pickup","targetname"); // Pickup trigger
staff_trig moveto(self.origin, 0.1);
        staff_trig enable_trigger();
flag_clear( "staff_part_build" );  // NOT SURE ABOUT THIS ONE, NEVER REALLY WORKED WITH FLAGS :)
staff_trig thread staff_part_pickup();


staff_hud_create()
{
      hud = create_simple_hud( self );
      hud.foreground = true;
      hud.sort = 1;
      hud.hidewheninmenu = false;
      hud.alignX = "right";
      hud.alignY = "bottom";
      hud.horzAlign = "right";
      hud.vertAlign = "bottom";
      hud.x = hud.x + 2;
      hud.y = hud.y - 75;
      hud.alpha = 1;
      hud SetShader( "staff_part_hud" , 75, 40 );
 
  self.buildable_hud[ "staff" ] = hud;
}

do_knuckle_crack()
{
   self DisableOffhandWeapons();
   self DisableWeaponCycling();

   self AllowLean( false );
   self AllowAds( false );
   self AllowSprint( false );
   self AllowProne( false );     
   self AllowMelee( false );
   
   if ( self GetStance() == "prone" )
   {
      self SetStance( "crouch" );
   }

   gun = self GetCurrentWeapon();
   weapon = "zombie_knuckle_crack";   
   self GiveWeapon( weapon );
   self SwitchToWeapon( weapon );
   self waittill_any( "fake_death", "death", "player_downed", "weapon_change_complete" );
   self EnableOffhandWeapons();
   self EnableWeaponCycling();
   self GiveWeapon( gun );
   self SwitchToWeapon( gun );
   self AllowLean( true );
   self AllowAds( true );
   self AllowSprint( true );
   self AllowProne( true );     
   self AllowMelee( true );
   return gun;
}
broken avatar :(
×
broken avatar :(
Senpai
Location: us
Date Registered: 28 September 2013
Last active: 3 years ago
Posts
605
Respect
Forum Rank
Zombie Enslaver
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
arceus's Groups
Box Mappers Elite
Box Mappers Elite
arceus's Contact & Social LinksarceusNT
also i just looked back and from what i understand  you want it t NOT drop at the player if so just delete the moveto lines if not well nothing then
broken avatar :(
×
broken avatar :(
Location: usUsa
Date Registered: 21 July 2013
Last active: 1 month ago
Posts
53
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
lordkurt6's Groups
lordkurt6's Contact & Social LinkstehfeedzPryZeWaRVii
iv added in bit more but with lot help I got script to work just one bug so far as I can see trying disable build trigger when u gone down model allreally repsawn which is good but i can still build the part after building down bad at spelling read this take time lol

/////////////////////////////////////////////////////////////////////////////////////////////





Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;
#include maps\_hud_util;

precache_test_script()
{
   PrecacheItem( "zombie_knuckle_crack" );
   precachemodel( "static_seelow_shovel" );
   precacheshader( "staff_part_hud");
}     

main()
{
   flag_init("staff_part_build");
   flag_init("staff_part_drop");   
   level thread staff_part_pickup();
   level thread staff_part_build();
   level thread staff_part_drop();
}

staff_part_pickup()
{
 while(1)
  {
   staff_part_trig = GetEnt("staff_part_pickup","targetname");
   haspart = undefined;
   staff_part_trig sethintstring( "Press &&1 to pick up staff part"  );
   staff_part_trig setCursorHint( "HINT_NOICON" );
   staff_part_trig UseTriggerRequireLookat();
   player = undefined;
   staff_part_model = getent("staff_part_model", "targetname"); // Pickup model
   staff_part_trig waittill("trigger", player);
   player thread staff_hud_create();
   flag_set( "staff_part_build" );
   player.haspart = true;
   user[i] notify("staff_part_build");
   playfx (level._effect["fx_fire_barrel_med"], self.origin);
   staff_part_model hide();
   staff_part_trig disable_trigger();
  }
}

staff_part_build()
{
   build_trig = GetEnt("staff_part_build","targetname"); // Build trigger
   build_trig setCursorHint( "HINT_NOICON" );
   build_trig UseTriggerRequireLookat();
   staff_part_model = getent("staff_part_build", "targetname"); // Build Model
   staff_part_model hide();
   
   player = undefined;
   flag_wait( "staff_part_build" );
   build_trig sethintstring( "Press and hold &&1 to build staff part"  );
   
    while(1)                                                                              //////////////// Don Gooney's Hacker Function ////////////////
    {
build_trig waittill( "trigger" , player );
// if(user[i].haspart == true )
{
self notify("staff_part_build");
build_trig playsound( "soul_fly" );
timer = 0;
if(level.timedout)
{
hack_time = 2;
}
else
{
hack_time = 2;
}
Texthud = newClientHudElem(player);
Texthud.alignX = "center";
Texthud.alignY = "middle";
Texthud.horzAlign = "center";
Texthud.vertAlign = "bottom";
Texthud.y = -148;
Texthud.foreground = true;
Texthud.font = "default";
Texthud.fontScale = 1.8;
Texthud.alpha = 1;
Texthud.color = ( 1.0, 1.0, 1.0 );
Texthud setText( "BUILDING PART" );
ProgressBar = player createPrimaryProgressBar();                     //////////////// Don Gooney's Hacker Function ////////////////
ProgressBar updateBar( 0.01, 1 / hack_time );
ProgressBar.color = ( .5, 1, 1 );
while(player useButtonPressed())
{
wait 0.05;               
timer += 0.05;
                 
player thread do_knuckle_crack();
                 
if ( player maps\_laststand::player_is_in_laststand())
{
break;
}
if( timer >=  hack_time)
{
ProgressBar destroyElem();
                Texthud destroy();
playfx (level._effect["fx_fire_barrel_med"], staff_part_model.origin);
build_trig show();
build_trig playsound( "soul_fly" );
build_trig disable_trigger();
{
break;
}
}
}
}
ProgressBar destroyElem();
Texthud destroy();
    }
}

staff_part_drop()
{
    while(1)
    {
user = getplayers();
for( i = 0; i < user[i].size; i++ )
{
user[i] waittill_any( "fake_death", "death", "player_downed");
{
flag_wait( "staff_part_drop" );
staff_part_model = getent("staff_part_model", "targetname"); // Pickup model
staff_part_model moveto (self.origin);
staff_part_model show(); // forgot the ; here
user[i].haspart = false ;

staff_part_trig = GetEnt("staff_part_pickup","targetname"); // Pickup trigger
staff_part_trig moveto (user[i].origin);
staff_part_trig enable_trigger();
{
break;
}

}
}
    }


staff_hud_create()
{
      hud = create_simple_hud( self );
      hud.foreground = true;
      hud.sort = 1;
      hud.hidewheninmenu = false;
      hud.alignX = "right";
      hud.alignY = "bottom";
      hud.horzAlign = "right";
      hud.vertAlign = "bottom";
      hud.x = hud.x + 2;
      hud.y = hud.y - 75;
      hud.alpha = 1;
      hud SetShader( "staff_part_hud" , 75, 40 );
 
while(1)
{
user = getplayers();
for( i = 0; i < user[i].size; i++ )
{
user[i] waittill_any( "fake_death", "death", "player_downed");
{
if(user[i].haspart == true )
{
build_trig = GetEnt("staff_part_build","targetname"); // Build trigger
build_trig disable_trigger();
hud destroy();
flag_set( "staff_part_drop" );
}
user[i] wait("staff_part_build");
{
user[i].haspart = true ;
build_trig = GetEnt("staff_part_build","targetname"); // Build trigger
flag_set( "staff_part_build" );
build_trig enable_trigger();
}
}
}
}
}  

do_knuckle_crack()
{
   self DisableOffhandWeapons();
   self DisableWeaponCycling();

   self AllowLean( false );
   self AllowAds( false );
   self AllowSprint( false );
   self AllowProne( false );     
   self AllowMelee( false );
   
   if ( self GetStance() == "prone" )
   {
      self SetStance( "crouch" );
   }

   gun = self GetCurrentWeapon();
   weapon = "zombie_knuckle_crack";   
   self GiveWeapon( weapon );
   self SwitchToWeapon( weapon );
   self waittill_any( "fake_death", "death", "player_downed", "weapon_change_complete" );
   self EnableOffhandWeapons();
   self EnableWeaponCycling();
   self GiveWeapon( gun );
   self SwitchToWeapon( gun );
   self AllowLean( true );
   self AllowAds( true );
   self AllowSprint( true );
   self AllowProne( true );     
   self AllowMelee( true );
   return gun;
}
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
this part is pretty messed up:

Code Snippet
Plaintext
while(1)
    {
user = getplayers();
for( i = 0; i < user[i].size; i++ )
{
user[i] waittill_any( "fake_death", "death", "player_downed");
{
flag_wait( "staff_part_drop" );
staff_part_model = getent("staff_part_model", "targetname"); // Pickup model
staff_part_model moveto (self.origin);
staff_part_model show(); // forgot the ; here
user[i].haspart = false ;

staff_part_trig = GetEnt("staff_part_pickup","targetname"); // Pickup trigger
staff_part_trig moveto (user[i].origin);
staff_part_trig enable_trigger();
{
break;
}

}
}
    }

in the first place, why would you want to run this on all players, and not jus tthe player that picked up the part. And
secondly, the for-loop stops at the first waittill, so it only runs on player[0] every time, and then it breaks out of the loop. Also wondering why it's inside a while(1) loop to begin with. Might wanna try that coop.
also there's no check to see if the player actually has the part when he hits the build trigger...

And the correct syntax would be:

Code Snippet
Plaintext
user = getplayers();
for( i = 0; i < user.size; i++ )
Last Edit: October 25, 2014, 03:02:23 pm by BluntStuffy
broken avatar :(
×
broken avatar :(
Location: usUsa
Date Registered: 21 July 2013
Last active: 1 month ago
Posts
53
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
lordkurt6's Groups
lordkurt6's Contact & Social LinkstehfeedzPryZeWaRVii
how would I go making see if player checks if player has part befor building
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
well, in this version you would just uncomment the

Code Snippet
Plaintext
	// if(user[i].haspart == true )

and change it into:

Code Snippet
Plaintext
	 if( isdefined(player.haspart) && player.haspart )




and just to be safe, put a

Code Snippet
Plaintext
wait 0.1;

right above the last line that says:

Code Snippet
Plaintext
ProgressBar destroyElem();





But later on if you adding more parts, you need a way to check wich part the player has..
broken avatar :(
×
broken avatar :(
Location: usUsa
Date Registered: 21 July 2013
Last active: 1 month ago
Posts
53
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
lordkurt6's Groups
lordkurt6's Contact & Social LinkstehfeedzPryZeWaRVii
ok thanks I try that now and yeah I know that will be hard but more I keep trying it will work soon or later (:

 
Loading ...