• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Door Key System

Status
Not open for further replies.
Level 6
Joined
May 26, 2010
Messages
212
I'm looking for a system that uses an item [The Key] to open a door. You use it by using the item on the door and it opens it then it closes it after about 5 seconds. Below is my attempt at it.
  • House 1
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Item-type of (Sold Item)) Equal to |cffffcc00Buy House|r
      • (Selling unit) Equal to Home Dealership [House] 0003 <gen>
    • Actions
      • Item - Remove (Sold Item)
      • Hero - Create Key and give it to (Buying unit)
      • Set Key[1] = (Last created item)
      • Unit - Hide Home Dealership [House] 0003 <gen>
  • House 1 Key
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Key
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item being manipulated) Equal to Key[1]
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Target destructible of ability being cast) Equal to Door (Horizontal) 0315 <gen>
            • Then - Actions
              • Wait 0.15 seconds
              • Destructible - Open Door (Horizontal) 0315 <gen>
              • Wait 5.00 seconds
              • Destructible - Close Door (Horizontal) 0315 <gen>
            • Else - Actions
              • Destructible - Close Door (Horizontal) 0315 <gen>
        • Else - Actions
  • Key Bug Fix
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Key
    • Actions
      • Wait 0.10 seconds
      • Destructible - Close (Target destructible of ability being cast)
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
I think its ok except the third trigger try disabling it and see what happens :)
And it could be done a bit easier by 2 triggers for all the houses you have. Like this you will have to do 2 triggers for each house.
 
Status
Not open for further replies.
Top