# Combat in ChoiceScript for newbie

**URL:** <https://forum.choiceofgames.com/t/combat-in-choicescript-for-newbie/24887>\
**Category:** ChoiceScript Help\
**Created:** [March 19, 2017, 3:12pm UTC](https://forum.choiceofgames.com/t/combat-in-choicescript-for-newbie/24887 "2017-03-19T15:12:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonnysaxc](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@Jonnysaxc](https://forum.choiceofgames.com/u/Jonnysaxc)\
**Post date:** [March 19, 2017, 3:12pm UTC](https://forum.choiceofgames.com/t/combat-in-choicescript-for-newbie/24887/1 "2017-03-19T15:12:54Z")

</div>

Hi,

I am brand new to ChoiceScript. I have written a fighting fantasy type game complete with fights that would have been done “in the old days” by rolling 2 d 6 etc!

Is combat and luck rolls something that would be coded? or just left to "roll two dice, if you win " etc?

Thanks for any advice

---

<div class="post-metadata">

**Author:** ![EmperorHeartless](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/emperorheartless/32/14996_2.png) [@EmperorHeartless](https://forum.choiceofgames.com/u/EmperorHeartless)\
**Post date:** [March 19, 2017, 3:32pm UTC](https://forum.choiceofgames.com/t/combat-in-choicescript-for-newbie/24887/2 "2017-03-19T15:32:14Z")

</div>

You can code it using the \*rand command to randomly choose between a set of numbers.

(straight off the choiceofgames chociescript tutorial)

\*rand: Set a variable to a random number. You set the minimum and maximum, we do the rest. For example, this would set the variable die\_roll to a value from 1 to 6 inclusive:

\*rand die\_roll 1 6

---

<div class="post-metadata">

**Author:** ![Jonnysaxc](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@Jonnysaxc](https://forum.choiceofgames.com/u/Jonnysaxc)\
**Post date:** [March 19, 2017, 4:39pm UTC](https://forum.choiceofgames.com/t/combat-in-choicescript-for-newbie/24887/3 "2017-03-19T16:39:43Z")

</div>

Many thanks, will give it a go!
