Page 1 of 1

[script] halp lol

Posted: Wed Nov 30, 2016 9:52 am
by S_hift
So I was trying to copy this block of code from lemons dropper script and get it to drop other items as well... Essentially I want it to be able to drop as many weapons as I want, while working in any mod including base.

Code: Select all

function nextWeapon()
{
	drop(Blaster);
	// Up to the server right now
	remoteEval(2048,nextWeapon);
}
function nextWeapon()
{
	drop(Shotgun);
	// Up to the server right now
	remoteEval(2048,nextWeapon);
}
function nextWeapon()
{
	drop(Thumper);
	// Up to the server right now
	remoteEval(2048,nextWeapon);
}
Oddly enough it doesn't work. would the get current weapon function work better/more universally?

Re: [script] halp lol

Posted: Wed Nov 30, 2016 11:43 am
by perrinoia
What you've done is overwrite the same function 3 times, inserting the command to drop a single item.

If your objective is to drop your current weapon every time you switch weapons, then use drop(Weapon);

Example:

Code: Select all

function nextWeapon()
{
   drop(Weapon);
   // Up to the server right now
   remoteEval(2048,nextWeapon);
}

If you don't want to drop your weapon EVERY time you switch weapons, then write your own function just like the next weapon function and make a different keybind.

Example:

Code: Select all

function dropWeapon()
{
   drop(Weapon);
   // Up to the server right now
   remoteEval(2048,nextWeapon);
}

bindCommand(keyboard0, make, alt, "q", TO, "dropWeapon();");
Or you can keep dropping and switching weapons until you release the key:

Code: Select all

function nextWeapon()
{
	if($dropWeapons)
	{
		drop(Weapon);
		schedule("nextWeapon();", 0.1);
	}
	// Up to the server right now
	remoteEval(2048, nextWeapon);
}

bindCommand(keyboard0, make, alt, "q", TO, "$dropWeapons = true; nextWeapon();");
bindCommand(keyboard0, break, alt, "q", TO, "$dropWeapons = false;");

Re: [script] halp lol

Posted: Wed Nov 30, 2016 2:01 pm
by S_hift
How could I get it to auto drop from the inventory? Without having to switch weapons? And could it be armor specific?


Also how could I have a custom weapon rotation? As opposed to the servers default weapon rotation? Also armor specific

Re: [script] halp lol

Posted: Wed Nov 30, 2016 2:25 pm
by S_hift

Code: Select all

function nextWeapon()
{
   if($dropWeapons)
   {
      drop(blaster);
      schedule("nextWeapon();", 0.1);
   }
   else if($dropWeapons)
   {
      drop(shotgun);
      schedule("nextWeapon();", 0.1);
   }
   else if($dropWeapons)
   {
      drop(thumper);
         if($dropWeapons)
   }
   // Up to the server right now
   remoteEval(2048, nextWeapon);
}
Would this work the way i originally intended?

Re: [script] halp lol

Posted: Wed Nov 30, 2016 3:31 pm
by perrinoia
I dunno what you originally intended. Give it a try.

To make a custom weapon rotation, make a list of weapons in your preferred order, and I'll write the script.

Re: [script] halp lol

Posted: Sat Dec 03, 2016 12:41 pm
by S_hift
Titan- particlebeam,rocketlauncher,plasmagun,babynukelauncher,stinger

Anni spawn - disclauncher,plasmagun,thumper,blaster,shotgun

But maybe slots to add armors and weapons

Re: [script] halp lol

Posted: Wed Dec 07, 2016 1:42 pm
by perrinoia
Just make one list of all items and sort it by preference.
Keeping track of what armor you've got is complicated. Requires modifying or attaching to at least 3 additional functions.