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 913 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.
  • undefined Offline
    undefined Offline
    ytjusteli
    wrote on Dec 12, 2022, 9:36 PM 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

    undefined 1 Reply Last reply Dec 12, 2022, 9:52 PM
    0
    • undefined Offline
      undefined Offline
      TheGreatReaper Contributor
      replied to ytjusteli on Dec 12, 2022, 9:52 PM 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
      
      undefined 1 Reply Last reply Dec 13, 2022, 5:30 PM
      1
      • undefined Offline
        undefined Offline
        ripthaddeus
        replied to TheGreatReaper on Dec 13, 2022, 5:30 PM last edited by
        #3

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

        1 Reply Last reply
        0
        • undefined Offline
          undefined Offline
          Resxt Plutonium Staff
          wrote on Dec 13, 2022, 5:51 PM 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
          • undefined Offline
            undefined Offline
            ytjusteli
            wrote on Dec 17, 2022, 6:12 AM last edited by
            #5

            Resxt thx bro

            1 Reply Last reply
            0

            4/5

            Dec 13, 2022, 5:51 PM

            • Login

            • Don't have an account? Register

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