Adding Items To Units Based On Players Playing.
Moderator: Cheaters
-
- Newcomer
- Posts: 9
- Joined: May 19th, 2009, 8:29 pm
Adding Items To Units Based On Players Playing.
I want to make it so a Unit such as "Kel'Thuzad" will get items such as "Ring of Protection +2" when there are more than 1 player currently playing on the start of the game.
-
- Forum Staff
- Posts: 506
- Joined: November 17th, 2008, 3:49 pm
Re: Adding Items To Units Based On Players Playing.
Code: Select all
Untitled Trigger 001
Events
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of players in (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))) Greater than 1
Then - Actions
Unit Group - Pick every unit in (Units owned by (Picked player) matching ((((Matching unit) is A Hero) Equal to True) and (((Matching player) controller) Equal to User))) and do (Hero - Create Ring of Protection +2 and give it to (Picked unit))
Else - Actions
Edit : To make this easier, i uploaded the map with the trigger in it, just copy the if/than/else into your map.
You do not have the required permissions to view the files attached to this post.

-
- Junior Member
- Posts: 44
- Joined: April 12th, 2007, 2:43 am
- Location: STALKER!!!
Re: Adding Items To Units Based On Players Playing.
Syre, there is no Picked Player in your trigger currently 
It won't work.
Here:
If you have something like brown as a computer, just change the loop to go from 1 to 11 or something 

It won't work.
Here:
Code: Select all
Untitled Trigger 001
Events
Conditions
Actions
For each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Player((Integer A))) controller) Equal to User
((Player((Integer A))) slot status) Equal to Is playing
Then - Actions
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units owned by (Player((Integer A))) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
Loop - Actions
Hero - Create Ring of Protection +2 and give it to (Picked unit)
Else - Actions

"Sticks and stones may break my bones, but words will never hurt me!" Ouch! MY ARM!! YOU BROKE MY ARM!!