---
id: 5dbbb5076ef5fe3a704f849d
title: Part 124
challengeType: 0
isHidden: true
---
## Description
If you play the game in its current state you might notice a bug. If your `xp` is high enough, the `getMonsterAttackValue` function will sometimes return a negative number, which will actually add to your total health when fighting a monster!
In `getMonsterAttackValue`, change `return hit` to a ternary operator that returns `hit` if `hit` is greater than 0, or returns 0 if it is not.
For example, here's a function that returns 5 if `tickets` is greater than 3, or returns 0 if it is not:
```js
function applyDiscount(tickets) {
return tickets > 2 : 5 : 0;
}
```
## Instructions
## Tests
```yml
tests:
- text: See description above for instructions.
testString: assert(getMonsterAttackValue.toString().replace(/\s/g, '').includes('returnhit>0?hit:0'));
```
## Challenge Seed
```html
```
### Before Test
```html
RPG - Dragon Repeller
XP: 0Health: 100Gold: 50
Monster Name: Health:
Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above.