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

[Trigger] Picking a player

Status
Not open for further replies.
Level 5
Joined
Dec 18, 2007
Messages
205
if you want to do one single action, then use something like this:

  • Player - Set (Random player from (All players matching (((Matching player) slot status) Equal to Is Playing))) Current Gold to 750
Instead of All Players use your target group. Do the same with the function below.

If you want to do more than one action use a variable and then use that variable for all actions:

  • Set Player = (Random player from (All players matching (((Matching player) slot status) equal to is playing)))
If player-group could be empty use s.th. like this:

  • Custom script: if udg_Player == null then
  • Game - Display to (All players) the text: No Player!
  • Skip remaining actions
  • Custom script: endif
 
Level 20
Joined
Oct 21, 2006
Messages
3,231
  • Set PlayerGroup1 = (All players controlled by a User player)
  • Set PlayerGroup2 = (Player group((Random player from PlayerGroup1)))
  • Player Group - Pick every player in PlayerGroup2 and do (Actions)
    • Loop - Actions
  • Custom script: call DestroyForce(udg_PlayerGroup1)
  • Custom script: call DestroyForce(udg_PlayerGroup2)
 
Status
Not open for further replies.
Top