can only have one of item?

serb7

New Member
Reaction score
1
how would i make it to where you can only buy 1 or have 1 of a certain item in your inventory?
 

Shura

New Member
Reaction score
45
Trigger:
  • trigger
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
              • (Item carried by (Triggering unit) in slot (Integer A)) Not equal to (Item being manipulated)
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Game - Display to (All players) the text: You can't have two ...
            • Else - Actions

That will make it so that no unit can have two of the same item in their inventory. If you wanted this to only work for specific items, add in a condition to check if the the item being manipulated is of a certain type.
 

serb7

New Member
Reaction score
1
Trigger:
  • trigger
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
              • (Item carried by (Triggering unit) in slot (Integer A)) Not equal to (Item being manipulated)
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Game - Display to (All players) the text: You can't have two ...
            • Else - Actions

That will make it so that no unit can have two of the same item in their inventory. If you wanted this to only work for specific items, add in a condition to check if the the item being manipulated is of a certain type.

that works perfectly if a unit picks up an item, but what if they buy it from a shop it still gives it to them... hmmmm
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top