- Joined
- Jun 20, 2017
- Messages
- 333
I'm trying to make a leaderboard where you have a total of 6 lives, and when all the lives are used up, the person gets defeated.
For example: when my unit has 0 hit points, it must heal it and lose 1 life.
The problem is the game will crash! in the first process without healing my unit!
For example: when my unit has 0 hit points, it must heal it and lose 1 life.
The problem is the game will crash! in the first process without healing my unit!
-
Setup Leaderboard
-
Events
- Time - Elapsed game time is 1.00 seconds
- Conditions
-
Actions
- Leaderboard - Create a leaderboard for (All players) titled <Empty String>
- Set VariableSet Leaderboard = (Last created leaderboard)
- Set VariableSet Integers_ChampionLives[(Player number of (Triggering player))] = 6
- Leaderboard - Add Player 23 (Emerald) to Leaderboard with label ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integers_ChampionLives[(Player number of (Triggering player))]))) + )|r)) and value (Integer((Life of West Champion 0448 <gen>)))
- Leaderboard - Add Player 24 (Peanut) to Leaderboard with label ((Name of Player 24 (Peanut)) + (( |cffffcc00( + (String(Integers_ChampionLives[(Player number of (Triggering player))]))) + )|r)) and value (Integer((Life of East Champion 0447 <gen>)))
- Leaderboard - Add Player 21 (Coal) to Leaderboard with label West mobs and value 0
- Leaderboard - Add Player 22 (Snow) to Leaderboard with label East mobs and value 0
-
Events
-
Champion Hit Points
-
Events
- Time - Every 0.50 seconds of game time
- Conditions
-
Actions
- Leaderboard - Change the value for Player 23 (Emerald) in Leaderboard to (Integer((Life of West Champion 0448 <gen>)))
- Leaderboard - Change the value for Player 24 (Peanut) in Leaderboard to (Integer((Life of East Champion 0447 <gen>)))
- -------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Life of West Champion 0448 <gen>) Less than or equal to 500.00
-
Then - Actions
- Game - Display to (All players) for 10.00 seconds the text: |cffff0000West Cham...
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Life of West Champion 0448 <gen>) Equal to 1.00
-
Then - Actions
- Unit - Set life of West Champion 0448 <gen> to 100.00%
- Game - Display to (All players) for 10.00 seconds the text: (West Champion heald! heals remaining: + (String((Integers_ChampionLives[(Player number of (Triggering player))] - 1))))
- -------- --------
- Set VariableSet Integers_ChampionLives[(Player number of (Triggering player))] = (Integers_ChampionLives[(Player number of (Triggering player))] - 1)
- Leaderboard - Change the value for Player 23 (Emerald) in Leaderboard to Integers_ChampionLives[(Player number of (Triggering player))]
-
Else - Actions
- Trigger - Turn on Victory <gen>
-
If - Conditions
- Else - Actions
-
If - Conditions
- -------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Life of East Champion 0447 <gen>) Less than or equal to 500.00
-
Then - Actions
- Game - Display to (All players) for 10.00 seconds the text: |cffff0000East Cham...
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Life of East Champion 0447 <gen>) Equal to 1.00
-
Then - Actions
- Unit - Set life of East Champion 0447 <gen> to 100.00%
- Game - Display to (All players) for 10.00 seconds the text: (East Champion heald! heals remaining: + (String((Integers_ChampionLives[(Player number of (Triggering player))] - 1))))
- -------- --------
- Set VariableSet Integers_ChampionLives[(Player number of (Triggering player))] = (Integers_ChampionLives[(Player number of (Triggering player))] - 1)
- Leaderboard - Change the value for Player 24 (Peanut) in Leaderboard to Integers_ChampionLives[(Player number of (Triggering player))]
-
Else - Actions
- Trigger - Turn on Victory <gen>
-
If - Conditions
- Else - Actions
-
If - Conditions
-
Events