• 🏆 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!

can someone check this thing?

Status
Not open for further replies.
Level 4
Joined
Apr 13, 2006
Messages
83
I made a repick triger the problem is that when it snaps away the hero I have at the time I tipe -repick it creates 4 new heroes :S HELP ME! please!

Events
Player - Player 1 (Red) types a chat message containing -repick as An exact match
Player - Player 2 (Blue) types a chat message containing -repick as An exact match
Player - Player 3 (Teal) types a chat message containing -repick as An exact match
Player - Player 4 (Purple) types a chat message containing -repick as An exact match
Player - Player 5 (Yellow) types a chat message containing -repick as An exact match
Player - Player 6 (Orange) types a chat message containing -repick as An exact match
Player - Player 7 (Green) types a chat message containing -repick as An exact match
Player - Player 8 (Pink) types a chat message containing -repick as An exact match
Player - Player 10 (Light Blue) types a chat message containing -repick as An exact match
Player - Player 11 (Dark Green) types a chat message containing -repick as An exact match


Conditions
----------------


Actions
Unit Group - Pick every unit in (Units in (Playable map area) owned by (Triggering player)) and do (Actions)
Loop - Actions
If (((Picked unit) is A Hero) Equal to True) then do (Unit - Remove (Picked unit) from the game) else do (Do nothing)
Unit - Remove (Picked unit) from the game
Unit - Create 1 Hero[(Random integer number between 1 and 26)] for (Triggering player) at (Center of Machupicha <gen>) facing Default building facing degrees
Sound - Play Laugh1 <gen>
Quest - Display to (All players) the Hint message: A player has repicked press -ma to check what it is using now...
 
Level 6
Joined
Apr 4, 2005
Messages
299
I think problem is with Pick every unit cycle.

I suggest you to save all player heroes to variables (array picked_hero or something else) where array index is equal to player index. So, if player 11 gets hero, it will be saved to picked_hero[11].

Then make thigger in same way, but remove pick every units and instead picked unit put in picked_hero[player index of(triggering player)]
 
Status
Not open for further replies.
Top