# "UserLabled" parameter scripting

**URL:** <https://qa.fmod.com/t/userlabled-parameter-scripting/15332>\
**Category:** FMOD Engine\
**Created:** [December 19, 2019, 8:23am UTC](https://qa.fmod.com/t/userlabled-parameter-scripting/15332 "2019-12-19T08:23:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chemberz](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/chemberz/32/496_2.png) [@chemberz](https://qa.fmod.com/u/chemberz)\
**Post date:** [December 19, 2019, 8:23am UTC](https://qa.fmod.com/t/userlabled-parameter-scripting/15332/1 "2019-12-19T08:23:57Z")

</div>

Hi, everybody!  
I’m trying to create labeled parameter via script. Unfortunately I couldn’t find any information about that and my script doesn’t work.  
How I can to define a labels in **addGameParameter()** method?  
How I can to define initial value?  
And how to use **addParameterCondition()** with labeled parameter correctly?

---

<div class="post-metadata">

**Author:** ![alexzzen](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/alexzzen/32/6825_2.png) [@alexzzen](https://qa.fmod.com/u/alexzzen)\
**Post date:** [December 19, 2019, 11:06am UTC](https://qa.fmod.com/t/userlabled-parameter-scripting/15332/2 "2019-12-19T11:06:21Z")

</div>

This example works for me:

> var param = event.addGameParameter(“”);  
> param.preset.presetOwner.name = “Test Parameter”;  
> param.preset.parameterType = 2;  
> param.preset.minimum = 0;  
> param.preset.maximum = 3;  
> var paramList = [‘First Label’, ‘Second Label’, ‘Third Label’];  
> param.preset.enumerationLabels = paramList;

initial value example:

> param.preset.initialValue = 1

and then:

> singleSound.addParameterCondition(param.preset, 2);

to add a trigger condition (`Third Label` here).

---

<div class="post-metadata">

**Author:** ![chemberz](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/chemberz/32/496_2.png) [@chemberz](https://qa.fmod.com/u/chemberz)\
**Post date:** [December 20, 2019, 7:16am UTC](https://qa.fmod.com/t/userlabled-parameter-scripting/15332/3 "2019-12-20T07:16:18Z")

</div>

Thank you, alexzzen. It works! 🙂
