Modme

New Modme platform coming soon!
Allow players to pick a starting pistol every game
Viewed 262 time(s)
Topic created on 1500237780
Original post
Modme User
2 wins

I had trouble deciding which starting pistol I wanted to use in my map, so I instead created a script to allow the player to decide for themselves!

This script currently only allows for 2 options. It gives the player 10 seconds, then takes away whichever gun they aren't holding.

 

Instructions:

 

Open your mapname.gsc located in (Call of Duty Black Ops III\usermaps\map_name\scripts\zm)

 

At the top, somewhere within main, add this line and replace the text in quotes with the name of the second weapon you want as an option:

 

level thread choose_pistol("t7_pistol_m1911");

 

Then, at the bottom, add this function:

 

function choose_pistol(secondWep)
{
	level flag::wait_till( "initial_blackscreen_passed" );
	players = GetPlayers();
	secondary = GetWeapon(secondWep);

	foreach(player in players)
		player GiveWeapon(secondary);
		
	IPrintLnBold("Choose your starting pistol. The other will disappear in 10 seconds.");
	wait(7);
	for(i=3;i>0;i--)
	{
		IPrintLnBold(i+"");
		wait(1);
	}
	foreach(player in players)
	{
		choice = player GetCurrentWeapon();
		ammo_clip = player GetWeaponAmmoClip(choice);
		ammo_fuel = player GetWeaponAmmoFuel(choice);
		ammo_stock = player GetWeaponAmmoStock(choice);
		player TakeAllWeapons();
		player GiveWeapon(choice);
		player giveWeapon( level.weaponBaseMelee );
		player SetWeaponAmmoClip(choice,ammo_clip);
		player SetWeaponAmmoFuel(choice,ammo_fuel);
		player SetWeaponAmmoStock(choice,ammo_stock);
		level thread zm::award_grenades_for_survivors(); 
	}
	IPrintLnBold("Starting pistol locked in.");
}

 

 

Done!

When you load into your map it will give you your "second" weapon alongside your normal starting pistol and after 10 seconds will take away the one you aren't holding.

 

 

Disclaimer: I am by no means an experienced scripter and it's very possible there's a better way to make this script so if anyone has suggestions for how it can be made better I'm open to hearing them. I would think there's probably a better way to do the last part of the script in particular, but I tried many different things and wasn't able to figure out a "better" way.

Reply #1 on 1500238292
Modme User
24 wins

This is awesome, great tutorial!


---{ Wild's BO3 Releases }---
Wild's Black Ops 2 Shader Pack! - http://modme.co/index.php?view=topic&tid=629
Wild's Round Sounds! - http://modme.co/index.php?view=topic&tid=1444
Wild's Shootable Perk-a-Holic! - http://kylequick.myportfolio.com/shootable-perk-a-holic

---{ Wild's BO3 Tutorials }---
Fix Custom Weapons Not Going In The Box! - http://modme.co/index.php?view=topic&tid=696

---{ View my portfolio here! (WIP) }---
http://kylequick.myportfolio.com
Reply #2 on 1500258282
Modme User
1 wins

oh my god thank you!!! i was literally thinking about this because i want to have all of the pistols from WAW - IW 

 

 

Reply #3 on 1500262951
Modme User
2 wins

Glad to help :)