Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var StillAlive = false; //To know when the boss is killed by the player
- var TempGold = 0; //Temporary hold to watch when it increases
- if (BossHealth > 0) StillAlive = true; //Boss is found
- if (BossHealth === undefined) StillAlive = false; //Player is slain, reset the condition.
- if (BossHealth = 0 && StillAlive = true) //Boss is slain
- {
- StillAlive = false; //Reset for next boss
- TempGold = PlayerGold; //Watching when it increases
- }
- if (PlayerGold > TempGold) split(); //It increased, split
- //If the value for BossHealth is null or undefined when not fighting said boss, just watch for when the value is 0.
- var TempGold = 0;
- if (BossHealth = 0) TempGold = PlayerGold;
- if (PlayerGold > TempGold)
- {
- split();
- TempGold = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement