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

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. Droppable Weapons

Droppable Weapons

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
bo2zombiesmodsideas
5 Posts 4 Posters 982 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.
  • ytjusteliundefined Offline
    ytjusteliundefined Offline
    ytjusteli
    wrote on last edited by
    #1

    Is is possible for someone to make a weapon drop feature for bo2????
    if there's already one can you send me the link please

    TheGreatReaperundefined 1 Reply Last reply
    0
    • TheGreatReaperundefined Offline
      TheGreatReaperundefined Offline
      TheGreatReaper Contributor
      replied to ytjusteli on last edited by
      #2

      ytjusteli

      //Put this in onPlayerSpawned()
      self thread drop_weapon();
      
      //Put this anywhere in your script
      drop_weapon()
      {
      	level endon("end_game");
      	self endon("disconnect");
      	for (;;) 
      	{
      		if (self meleebuttonpressed()) 
      		{
      			duration = 0;
      			while (self meleebuttonpressed()) 
      			{
      				duration += 1;
      				if (duration == 25) 
      				{
      					weap = self getCurrentWeapon();
      					self dropItem(weap);
      					break;
      				}
      				wait 0.05;
      			}
      		}
      		wait 0.05;
      	}
      }
      
      //Credits: Script from BOCW Mod by teh_bandit https://forum.plutonium.pw/topic/15807/release-zombies-cold-war-mod-final-update?_=1670881299406
      
      ripthaddeusundefined 1 Reply Last reply
      1
      • ripthaddeusundefined Offline
        ripthaddeusundefined Offline
        ripthaddeus
        replied to TheGreatReaper on last edited by
        #3

        TheGreatReaper How can i create and use this script i just can t do it

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

          Next time post in the right category.
          A question is not a release

          Basically what you need is this

          weap = self getCurrentWeapon();
          self dropItem(weap);
          

          I wrote the rest of the script to make it work
          Here's a download to the compiled file
          Once the script is loaded, holding the knife key for around 2.5s will drop your current weapon on the ground
          Instructions to load it

          Source code
          :::

          init()
          {
          	level thread onPlayerConnect();
          }
          
          onPlayerConnect()
          {
          	for (;;)
          	{
          		level waittill("connected", player);
          
          		player thread onPlayerSpawned();
          	}
          }
          
          onPlayerSpawned()
          {
          	for(;;)
              	{
          		self waittill("spawned_player");
          
          		self thread drop_weapon();
          	}
          }
          
          drop_weapon()
          {
          	level endon("end_game");
          	self endon("disconnect");
          	for (;;) 
          	{
          		if (self meleebuttonpressed()) 
          		{
          			duration = 0;
          			while (self meleebuttonpressed()) 
          			{
          				duration += 1;
          
          				if (duration == 25) 
          				{
          					weap = self getCurrentWeapon();
          					self dropItem(weap);
          					break;
          				}
          				wait 0.05;
          			}
          		}
          		wait 0.05;
          	}
          }
          
          //Credits: Script from BOCW Mod by teh_bandit https://forum.plutonium.pw/topic/15807/release-zombies-cold-war-mod-final-update?_=1670881299406
          

          :::

          1 Reply Last reply
          2
          • ytjusteliundefined Offline
            ytjusteliundefined Offline
            ytjusteli
            wrote on last edited by
            #5

            Resxt thx bro

            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