I was wondering if this could be modified using the $(count) command somehow so that every time the command is called, the odds of losing increase incrementally.

Then you can use a companion command like !reload that resets the counting variable within the command after someone loses:

After testing the above, without the math.random element it seems that the command always just counts backwards so you always â€świnâ€ť on the first 5 command pushes and â€śloseâ€ť on the 6th. The fun of a command like this comes from the randomness that you could lose at any time.

Additionally, with the randomness re-implemented, it would be fun for there to be a message that tracks how many â€śchancesâ€ť are left. An example return from Nightbot might read

If you really want the randomness, you can do it like this:

$(eval c = parseInt('$(count)'); Math.floor(Math.random() * (6 - c)) === 0 ? 'You died, please !reload' : `You survived, there are now ${c + 1} bullets in the magazine`)

The key is to make sure you get 0 when there are 6 bullets so you get a guaranteed loss, so when $(count) reaches 6, you multiply Math.random() by 0 because anything multiplied by 0 is equal to 0, therefore you need to multiply Math.random() by 6 minus $(count).

Correct me if Iâ€™m wrong, I believe that the current statistics for losing when pushing the above command break down as follows for the first 6 pushes:

Be clearer when you ask a question then, if you had those stats in mind when asking the question you should have shared them then.
â€śYou survived. 5 bullets remain.â€ť â€” this kinda implies that you add bullets every time.

I enjoy writing code to solve other peopleâ€™s â€śproblems,â€ť but donâ€™t take it for granted. NightDev has no obligation to provide you with code for your commands, and so do I: Iâ€™m not a NightDev employee, I do this as a volunteer.
I have no problem revisiting my code if I misunderstood what you were looking for, but here you just didnâ€™t explain what you were looking for properly, thereâ€™s a difference.
All I ask is that you have a clear idea of what youâ€™re looking for before you ask for help, and that you put efforts in explaining it clearly and in details so I donâ€™t have to guess and I can get straight to it, a bit like a scope statement. Yes, thatâ€™s work, but what am I doing for you if not work?
The least you can do to respect my time is to leave no room for guess work, code already requires (sometimes intense) creative work to translate the â€śproblemâ€ť in logical steps the language used can understand and execute.

I wrote a lot of commands for you already, one could have hoped you learnt a thing or two, youâ€™re pushing it.

Anyway, rant over, hereâ€™s the code youâ€™re looking for:

$(eval c = parseInt('$(count)'); Math.floor(Math.random() * (6 - (c - 1))) === 0 ? 'You died, please !reload' : `You survived, a maximum of ${6 - c} pulls remain`)