Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. [Support] [GSC] Jug / Weapon script

[Support] [GSC] Jug / Weapon script

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
19 Posts 5 Posters 1.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • KillaG4undefined Offline
    KillaG4undefined Offline
    KillaG4
    wrote on last edited by Mr. Android
    #1

    Looking for a simple script to give all users who join my zombie server Jugg and a gun i put in the code. I can only get it to give it to the first person who joins for some reason. Would love some help from someone who knows what they are doing.

    homuraundefined 1 Reply Last reply
    0
    • homuraundefined Offline
      homuraundefined Offline
      homura Banned
      replied to KillaG4 on last edited by
      #2

      KillaG4

      In the spawn loop make a foreach loop to loop through the players and give them the stuff.

      1 Reply Last reply
      0
      • KillaG4undefined Offline
        KillaG4undefined Offline
        KillaG4
        wrote on last edited by
        #3

        Well I don't really know what im doing so if someone knows how to do it I would greatly appreciate it 🙂

        1 Reply Last reply
        0
        • H3X1Cundefined Offline
          H3X1Cundefined Offline
          H3X1C Plutonium Staff
          wrote on last edited by
          #4

          Would help if you actually posted your code mate

          1 Reply Last reply
          0
          • KillaG4undefined Offline
            KillaG4undefined Offline
            KillaG4
            wrote on last edited by
            #5

            homura
            I'm looking for someone to write it from scratch. My code is worthless as I don't know what I was doing just copying and pasting. If they want some kind of payment im even down.

            1 Reply Last reply
            0
            • Mr. Androidundefined Offline
              Mr. Androidundefined Offline
              Mr. Android Plutonium Admin
              wrote on last edited by
              #6
              This post is deleted!
              1 Reply Last reply
              0
              • Mr. Androidundefined Offline
                Mr. Androidundefined Offline
                Mr. Android Plutonium Admin
                wrote on last edited by
                #7

                This isn't the place for that, we are not a marketplace. You'd be best approaching some established servers and seeing if their GSC developers want to be paid to make your mod.

                1 Reply Last reply
                0
                • KillaG4undefined Offline
                  KillaG4undefined Offline
                  KillaG4
                  wrote on last edited by KillaG4
                  #8
                  #include maps\mp\_utility;
                  #include common_scripts\utility;
                  #include maps\mp\zombies\_zm;
                  #include maps\mp\zombies\_zm_utility;
                  
                  
                  init()
                  {	
                  	for(;;)
                      {
                      level thread onPlayerConnect();
                      player thread onPlayerSpawned();
                      }
                  }
                  
                  onPlayerConnect()
                  {
                      for(;;)
                      {
                          level waittill("connected", player);
                          player thread onPlayerSpawned();
                      }
                  }
                  
                  onPlayerSpawned()
                  {
                      level endon("game_ended");
                      self endon("disconnect");
                      for(;;)
                      {
                          self waittill("spawned_player");
                  	player thread welcome();
                  	level.perk_purchase_limit = 9;
                      }
                  
                  }
                  
                  welcome()
                  {
                      self endon("disconnect");
                      self waittill("spawned_player");
                      self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" );
                      self giveWeapon( "ak74u_upgraded_zm" );
                      wait 7;
                      self iprintln("^2" +self.name + "^7 , your perk limit has been removed");
                  }
                  

                  Well if anyone wants to try to help off this feel free.

                  Drgnundefined 1 Reply Last reply
                  0
                  • Drgnundefined Offline
                    Drgnundefined Offline
                    Drgn Plutonium Staff
                    replied to KillaG4 on last edited by Drgn
                    #9

                    KillaG4 Don't set perk limit on spawn, set that on init.
                    Also you are threading onplayerspawn multiple times.

                    1 Reply Last reply
                    0
                    • KillaG4undefined Offline
                      KillaG4undefined Offline
                      KillaG4
                      wrote on last edited by
                      #10

                      Yea Dont know what i had onplayerspawn multiple times this was the correct way i had it before I believe

                      #include maps\mp\_utility;
                      #include common_scripts\utility;
                      #include maps\mp\zombies\_zm;
                      #include maps\mp\zombies\_zm_utility;
                      
                      
                      init()
                      {	
                          for(;;)
                          {
                          level thread onPlayerConnect();
                          level.perk_purchase_limit = 9;
                          }
                      }
                      
                      onPlayerConnect()
                      {
                          for(;;)
                          {
                              level waittill("connected", player);
                              player thread onPlayerSpawned();
                          }
                      }
                      
                      onPlayerSpawned()
                      {
                          level endon("game_ended");
                          self endon("disconnect");
                          for(;;)
                          {
                              self waittill("spawned_player");
                      	player thread welcome();
                          }
                      
                      }
                      
                      welcome()
                      {
                          self endon("disconnect");
                          self waittill("spawned_player");
                          self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" );
                          self giveWeapon( "ak74u_upgraded_zm" );
                          wait 7;
                          self iprintln("^2" +self.name + "^7 , your perk limit has been removed");
                      }
                      
                      1 Reply Last reply
                      0
                      • KillaG4undefined Offline
                        KillaG4undefined Offline
                        KillaG4
                        wrote on last edited by
                        #11

                        Now the server is crashing over and over again on startup

                        1 Reply Last reply
                        0
                        • KillaG4undefined Offline
                          KillaG4undefined Offline
                          KillaG4
                          wrote on last edited by
                          #12

                          This isnt crashing now but nothing happens when the game starts

                          #include maps\mp\_utility;
                          #include common_scripts\utility;
                          #include maps\mp\zombies\_zm;
                          #include maps\mp\zombies\_zm_utility;
                          
                          
                          init()
                          {	
                              level thread onPlayerConnect();
                              level.perk_purchase_limit = 9;
                          }
                          
                          onPlayerConnect()
                          {
                              for(;;)
                              {
                                  level waittill("connected", player);
                                  player thread onPlayerSpawned();
                              }
                          }
                          
                          onPlayerSpawned()
                          {
                              self endon("disconnect");
                              level endon("game_ended");
                              for(;;)
                              {
                              player thread welcome();
                          
                              }
                          }
                          
                          welcome()
                          {
                              self endon("disconnect");
                              self waittill("spawned_player");
                              self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" );
                              self giveWeapon( "ak74u_upgraded_zm" );
                              wait 7;
                              self iprintln("^2" +self.name + "^7 , your perk limit has been removed");
                          }
                          
                          
                          homuraundefined 1 Reply Last reply
                          0
                          • homuraundefined Offline
                            homuraundefined Offline
                            homura Banned
                            replied to KillaG4 on last edited by homura
                            #13

                            KillaG4 is it because you removed
                            self waittill("spawned_player"); from the player spawn loop? I'd say try that and see if that makes a difference.

                            1 Reply Last reply
                            0
                            • KillaG4undefined Offline
                              KillaG4undefined Offline
                              KillaG4
                              wrote on last edited by
                              #14

                              homura said in Jug / Weapon script:

                              #include maps\mp\_utility;
                              #include common_scripts\utility;
                              #include maps\mp\zombies\_zm;
                              #include maps\mp\zombies\_zm_utility;
                              
                              init()
                              {
                              	level.clientid = 0;
                              	level.perk_purchase_limit = 9;
                              	level thread onplayerconnect();
                              	player thread onplayerspawned();
                              }
                              
                              onplayerconnect()
                              {
                              	for ( ;; )
                              	{
                              		level waittill( "connecting", player );
                              		player.clientid = level.clientid;
                              		level.clientid++;
                              		player thread onplayerspawned();
                              	}
                              }
                              
                              onplayerspawned()
                              {
                              	level endon( "game_ended" );
                                      self endon( "disconnect" );
                              	
                              	for(;;)
                              	{
                              		self waittill( "spawned_player" );
                              		self IPrintLnBold( "^5whatever welcome message you want here" );
                              		self welcome();
                              	}
                              }
                              
                              welcome()
                              {
                                  self waittill( "spawned_player" );
                                  self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" );
                                  self giveWeapon( "mp5k_upgraded_zm" );
                                  wait 7;
                                  self iprintln("^2" +self.name + "^7 , your perk limit has been removed");
                              }
                              

                              It all works with this now, only issue now is the first person who joins the game doesnt get the gun. So once others start to join they all get the item and if the first player kills themselves then then get it

                              Drgnundefined 1 Reply Last reply
                              0
                              • Drgnundefined Offline
                                Drgnundefined Offline
                                Drgn Plutonium Staff
                                replied to KillaG4 on last edited by
                                #15

                                KillaG4 Generally you don't want to run the onplayerspawn thread twice like you are doing here in init and on connect.

                                1 Reply Last reply
                                0
                                • KillaG4undefined Offline
                                  KillaG4undefined Offline
                                  KillaG4
                                  wrote on last edited by
                                  #16

                                  hmm I keep ending up adding it back I believe it causes issues if i dont keep it in both spots. Ill play around with it again tomorrow.

                                  1 Reply Last reply
                                  0
                                  • KillaG4undefined Offline
                                    KillaG4undefined Offline
                                    KillaG4
                                    wrote on last edited by
                                    #17

                                    Anyone know how to make it so the first person who joins the server gets the welcome function?? Works for anyone else who joins just not the first person.

                                    1 Reply Last reply
                                    0
                                    • KillaG4undefined Offline
                                      KillaG4undefined Offline
                                      KillaG4
                                      wrote on last edited by KillaG4
                                      #18
                                      #include maps\mp\_utility;
                                      #include common_scripts\utility;
                                      #include maps\mp\zombies\_zm;
                                      #include maps\mp\zombies\_zm_utility;
                                      
                                      init()
                                      {
                                      	level.clientid = 0;
                                      	level.perk_purchase_limit = 9;
                                      	level thread onplayerconnect();
                                      }
                                      
                                      onplayerconnect()
                                      {
                                      	for ( ;; )
                                      	{
                                      		level waittill( "connecting", player );
                                      		player.clientid = level.clientid;
                                      		player thread onplayerspawned();
                                      		level.clientid++;
                                      	}
                                      }
                                      
                                      onplayerspawned()
                                      {
                                      	level endon( "game_ended" );
                                              self endon( "disconnect" );
                                      	
                                      	for(;;)
                                      	{
                                      		self welcome();
                                      	}
                                      }
                                      
                                      welcome()
                                      {
                                          self IPrintLnBold( "^Killa Server" );
                                          self waittill( "spawned_player" );
                                          self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" );
                                          self giveWeapon( "mp5k_upgraded_zm" );
                                          wait 7;
                                          self iprintln("^2" +self.name + "^7 , your perk limit has been removed");
                                      }
                                      

                                      Ok i fixed it, I was calling self waittill( "spawned_player" ); twice which was my issue. So if anyone is interested this will give Jug and a weapon and set perk limit to 9

                                      1 Reply Last reply
                                      1
                                      • KillaG4undefined Offline
                                        KillaG4undefined Offline
                                        KillaG4
                                        wrote on last edited by
                                        #19

                                        So after using it for a day I find if 2 players join while the game is going and then round ends and they join in it only gives 1 player the items and jug and just ignores the second player who also joined with them.

                                        1 Reply Last reply
                                        0

                                        • Login

                                        • Don't have an account? Register

                                        • Login or register to search.
                                        • First post
                                          Last post
                                        0
                                        • Recent
                                        • Tags
                                        • Popular
                                        • Users
                                        • Groups
                                        • Donate