• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Weapon Restriction Help

Status
Not open for further replies.
Level 2
Joined
Jun 11, 2009
Messages
9
I'm trying to make a Halo/Flood map, but I'm stuck making the trigger that makes it so that the people can only carry one gun, and when they try to get another one, they drop their old one.
 
Last edited:
Level 2
Joined
Jun 30, 2008
Messages
19
The best way that I've found to do it is to make all of the items you are going to use as guns, then, in the object editor, change their "Stats - Classification" to all be the same type e.g. Artifact. Then, create a trigger which checks if the hero already an artifact, and, if so, makes it so that they cant pick up the 2nd item of the same type.

What I am currently using is this, however I am 99% certain that it would be alot easier to make using variables, however I'm not that great with them so you might need someone else for that. Mine says something like this:

Event
Unit - A unit aqcuires an item

Condition
(Item class of (Item being Manipulated)) Equal to Artifact

Action
If ((((Triggering unit) has an item of type (Random level -1 Artifact item-type)) Equal to True) and (((Triggering unit) is A Hero) Equal to True)) then do (Advanced - Do (Hero - Drop (Item being manipulated) from (Triggering unit))

The action looks complicated, and I think it can be simplified, but I am working on it atm in my own map. The -1 Artifact item level just means that the artifact can be any level. Then it checks that the unit picking up the item is the hero, which may not be necessary for you. Then it drops the 2nd artifact item.

Hope this helps, sorry if it didn't.
 
Status
Not open for further replies.
Top