[script] halp lol

Post Reply
User avatar
S_hift
Posts: 1963
Joined: Fri Dec 23, 2011 1:42 pm

[script] halp lol

Post 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?
Image <--Click here to subscribe to S_hift's youtube
Click here for full access to all my tribes downloads
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: [script] halp lol

Post 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;");
Image
User avatar
S_hift
Posts: 1963
Joined: Fri Dec 23, 2011 1:42 pm

Re: [script] halp lol

Post 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
Image <--Click here to subscribe to S_hift's youtube
Click here for full access to all my tribes downloads
User avatar
S_hift
Posts: 1963
Joined: Fri Dec 23, 2011 1:42 pm

Re: [script] halp lol

Post 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?
Image <--Click here to subscribe to S_hift's youtube
Click here for full access to all my tribes downloads
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: [script] halp lol

Post 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.
Image
User avatar
S_hift
Posts: 1963
Joined: Fri Dec 23, 2011 1:42 pm

Re: [script] halp lol

Post by S_hift »

Titan- particlebeam,rocketlauncher,plasmagun,babynukelauncher,stinger

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

But maybe slots to add armors and weapons
Image <--Click here to subscribe to S_hift's youtube
Click here for full access to all my tribes downloads
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: [script] halp lol

Post 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.
Image
Post Reply