# Modifying Trigger Conditions "Chance" by FMOD script

**URL:** <https://qa.fmod.com/t/modifying-trigger-conditions-chance-by-fmod-script/22537>\
**Category:** FMOD Studio\
**Created:** [January 23, 2025, 11:00pm UTC](https://qa.fmod.com/t/modifying-trigger-conditions-chance-by-fmod-script/22537 "2025-01-23T23:00:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JSMallard](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@JSMallard](https://qa.fmod.com/u/JSMallard)\
**Post date:** [January 23, 2025, 11:00pm UTC](https://qa.fmod.com/t/modifying-trigger-conditions-chance-by-fmod-script/22537/1 "2025-01-23T23:00:21Z")

</div>

Hello! I have a bunch of events that I want to modify the chance percentage on. These each only have one track containing a single instrument. It seems like selecting the correct track and perhaps even the instrument is feasible through script; however, I haven’t found anything that can modify trigger conditions.

Is this something that is possible with fmod scripting? Thanks!

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [January 24, 2025, 5:26am UTC](https://qa.fmod.com/t/modifying-trigger-conditions-chance-by-fmod-script/22537/2 "2025-01-24T05:26:09Z")

</div>

Yes, this is entirely possible. To modify the trigger probability of an instrument, based on the structure you’ve described, you’d want to do something like the following:

```JavaScript
// assuming you've already got an event assigned to var "event"
// if there's only one non-master track, and one instrument on track
// we can assume both are index 0
var instrument = event.groupTracks[0].modules[0];
instrument.triggerProbabilityEnabled = true;
instrument.triggerProbability = 33;

```
