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

[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