• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Variable / Leaderboard Problem

Status
Not open for further replies.
Level 4
Joined
Apr 15, 2008
Messages
82
When a unit enters a region, it is suppsoed to explode and make the player lose a life. This works fine, other than the fact that the lives go from 30 to 28 when you lose your first life. I don't know what is wrong, but here is the trigger. I will link the map later, if needed.
Events
Unit - A unit enters CreepPath2Red <gen>
Conditions
(Owner of (Entering unit)) Equal to Player 9 (Gray)
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
lives[1] Greater than 0
Then - Actions
Game - Display to (All players) the text: ((Name of Player 1 (Red)) + has lost a life! )
Set lives[1] = (lives[1] - 1)
Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to (lives[1] - 1)
Unit - Explode (Entering unit)
Else - Actions
Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Actions)
Loop - Actions
Unit - Kill (Picked unit)
Game - Display to (All players) the text: ((Name of Player 1 (Red)) + has been defeated. Please give him plenty of trouble for dying.)
Set dead[1] = 1
 
Level 11
Joined
Dec 11, 2007
Messages
888
here is the problem:
Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to (lives[1] - 1)
change with this one:
  • Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to lives[1]
no need to set the value in leaderboard to lives[1]-1 if you done that already with the variable
 
Status
Not open for further replies.
Top