• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Duel System

Status
Not open for further replies.

kj_

kj_

Level 5
Joined
Aug 1, 2008
Messages
134
Hi Guys I want to make a duel system simalar to the one in angel arena
Like if Player 1 has highest score he would be fighting vs other player with 2nd highest score I have 6 players I've been try to make it by using if then else's but I can't figure out how it works

Help Apprec:thumbs_up:
:confused:
~kj_

:spell_breaker:+rep if you help:spell_breaker:
 
You need a loop to check what's the player with the highest score.
Be the variable score[] the one that stores the score for each player (integer), first the player index (integer) with the highest score and second the one with the second highest score.

  • Set first = 1
  • Set second = 2
  • For each integer (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
          • score[(Integer A)] greater than score[first]
        • Then - Actions
          • Set first = (Integer A)
          • -------- 'Then' means that the score of the player (Integer A) is greater than what we have found before ------
  • -------- Now 'first' is the index of the player with highest score. Let's find the second --------
  • For each integer (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
          • score[(Integer A)] greater than score[second]
          • (Integer A) not equal to first
          • -------- We will ignore the player with the highest score --------
        • Then - Actions
          • Set second = (Integer A)
 
Status
Not open for further replies.
Top