#✅ | how to make a difficulty slider?
1 messages · Page 1 of 1 (latest)
Use a Value List slider so the thumb can only land on your exact difficulty entries instead of every physical step. In the slider’s properties:
- Set Slider Type to Value List.
- Add four entries (e.g.
Peaceful,Easy,Normal,Hard). - Enable “Strict Value List” if you want to prevent the slider from stopping between entries.
- Use the slider’s actions and
$$value(or aSet Variableaction +Is Variable Valuerequirements) to react to the chosen difficulty.
That way the slider only cycles through your four defined difficulties instead of firing on every tiny movement. More details on sliders are in the Elements guide under the slider section.
where can I find the strict value list option?
The toggle is in the slider’s settings itself. Right-click the slider, choose Slider Settings, and you’ll find the Strict Value List option under the Value List entries (it appears once you set the type to “Value List”). Flip that on and the thumb will only sit on your four difficulties instead of every little tick.
If you need a refresher on Value List sliders, the slider section of the Elements guide covers it: Elements → Slider.
I dont see it, for the record im using version 3.8.1
Strict Value List only shows up once the slider is configured as a Value List type. Make sure you:
- Right-click the slider → Slider Settings.
- Under Slider Type, pick Value List.
- Add your four difficulty entries.
- The Strict Value List toggle appears right below the list entries once you’re in that mode; enable it to lock the thumb to those values.
If it still doesn’t show, double-check you’re not editing a Vanilla slider (those don’t expose that toggle) or that you don’t have the slider locked somewhere else. The slider section of the Elements guide has more details: Elements → Slider.
yes it is set as a value list slider but I dont see the toggle anywhere in the sliders context menu
If you already set the slider to Value List and still can’t find the toggle, it’s hidden inside the Slider Settings panel (not the right-click context menu). Open the slider, click Slider Settings, scroll down past the value entries—there’s a checkbox labeled Strict Value List right under the list. It only appears when the slider is actually in Value List mode.
If that panel still looks different, make sure you’re editing a custom slider (vanilla sliders don’t expose the same controls) and that the layout isn’t loading a template that locks the settings. You can read up on the slider options in the Elements → Slider section if you need a refresher.
where can I find the slider settings panel if its elsewhere from the context menu?
The Slider Settings panel is available from the slider’s own context menu. Right-click your custom slider → choose Slider Settings (it sits near the top of the list). That opens the full configuration screen where you can scroll past the value entries to find the Strict Value List toggle (it only appears once the slider is set to Value List mode).
If the option is missing, double-check you’re working with a custom slider element (vanilla sliders have a different menu) and that you’re not editing a template/preset that locks the controls. You can see the full slider options in the Elements guide under “Slider”: Elements → Slider.
I am for a fact using a custom slider without any presets, and I am for a fact setting it as a value list slider, but none of these strict value list or slider settings menus or buttons exist. are you sure this isnt on a newer version than version 3.8.1?
The “Strict Value List” toggle was added after 3.8.1, which is why you won’t find it in that version’s menus. You’d either need to update FancyMenu to the latest release to get that option or simulate it by using an integer slider (e.g. range 0–3) and handling the four difficulties via an action script/$$value mapping.
For reference on how sliders work (and how to drive value-based logic with them), see the slider section of the Elements guide: Elements → Slider.
well how can I make this work if that toggles out of the question? as of now ive been trying to mimic the vanilla difficulty toggle button
Since 3.8.1 doesn’t have the “Strict Value List” toggle yet, the only reliable way to get a discrete 4-step difficulty slider is to use an Integer Range slider instead of the Value List:
- Set the slider’s type to Integer Range.
- Configure the range from
0to3and set the step (tick spacing) to1. That way the thumb only lands on those four numeric values. - Use the slider’s action script (or a Ticker/Variable combo) to translate each numeric value into the corresponding difficulty name and run whatever logic you need (e.g., update text, call
sendmessageto mimic difficulty toggles, etc.).
If you really want the Value List behavior, the only other option is to update FancyMenu to a newer version that introduces the Strict Value List toggle. In the meantime, the integer slider trick gives you the exact four steps you need.
You can read more about slider options in the Elements guide under “Slider”: Elements → Slider.
how could I then make a custom action script to assign these integers to the 4 difficulties?
You can handle the integer slider with an action script that maps each 0…3 step to a difficulty. Example workflow:
- Make the slider an Integer Range from
0to3with a step of1. - In the slider’s Action Script, add an IF/ELSE-IF chain that checks the
$$valuevariable (that’s the slider’s current number) using an Is Number requirement. - Inside each branch, add actions that do whatever you need per difficulty—e.g.
Set Variable Valueto store the difficulty name andSend Chat Message(orMimic Keybind) to run/difficulty peaceful,/difficulty easy, etc.
A simple script outline:
IF (Is Number: $$value equals 0)
→ Set Variable Value: difficulty_name:Peaceful
→ Send Chat Message: /difficulty peaceful
ELSE-IF (equals 1)
→ … (Easy)
…
ELSE
→ … (Hard)
You can also update UI text via a Text element that shows {"placeholder":"getvariable","values":{"name":"difficulty_name"}}. This keeps the slider in sync with the actual difficulty.
For more details on building action scripts, see the Action Scripts guide: Action Scripts.
for the else if statements would I also be doing if number equals (number) requirements like the original if statement? I tried structuring the action script like that but nothing works
Yes, every ELSE-IF block needs its own Is Number requirement that checks $$value against its target number, just like the first IF. The structure should look like this:
IF (Is Number → equals → number: $$value → compare_with: 0)
└─ Set Variable Value / Send message for Peaceful
ELSE-IF (Is Number → equals → number: $$value → compare_with: 1)
└─ Actions for Easy
ELSE-IF (… compare_with: 2)
└─ Actions for Normal
ELSE
└─ Actions for Hard
Make sure:
- Each requirement is referencing
$$valuein the “number” field and the desired index (0‑3) in “compare_with.” - The actions (Set Variable, Send Chat Message, etc.) are nested inside the correct
IF/ELSE-IF/ELSEblock (you should see them indented). - You cover all four values—either via
ELSE-IFfor 0, 1, 2 andELSEfor 3, or anELSE-IFfor each.
If you need a text label showing the current difficulty, store names in a variable (difficulty_name) inside each branch and show it with {"placeholder":"getvariable","values":{"name":"difficulty_name"}}.
Check the Action Scripts page for more detail: Action Scripts.
should it be equals to (number) or compare to (number)?
Use the Equals compare mode. In each Is Number requirement:
- Put
{"placeholder":"calc","values":{"decimal":"false","expression":"$$value"}}(or just$$valueif the input accepts it) into the Number field — this is the value you’re testing. - Enter the target index (
0,1,2,3) into the Compare With field.
So the requirement reads “$$value equals 0”, “$$value equals 1”, etc. That way each IF/ELSE-IF branch only runs for the matching slider step.
If you need a reminder on Requirements, the Conditions guide explains the Is Number setup: Conditions (Requirements).
okay that worked! last thing to ask is if I can make it so the slider rests at the set value when I come back into the settings menu
Glad that part worked! To have the slider “remember” the last position when you reopen the menu, store the slider value in a FancyMenu variable and feed it back into the slider’s Pre-Selected Value field:
- Create a variable (e.g.,
difficulty_value) via Customization → Variables → Manage Variables. - In your slider’s action script (the same IF/ELSE chain that sets the difficulty), add a Set Variable Value action in each branch to write
difficulty_value:$$value. - In the slider settings, set Pre-Selected Value to
{"placeholder":"getvariable","values":{"name":"difficulty_value","default":"0"}}so the slider initializes from that variable each time the screen loads. - Optionally show the human-readable difficulty name via another variable (like
difficulty_name) and display it in a Text element with{"placeholder":"getvariable","values":{"name":"difficulty_name"}}.
That way the slider always returns to the last chosen step. You can find more about action scripts and variables here:
I did what you said and it just still automatically sets to 0
If the slider still snaps back to 0, it usually means the Pre-Selected Value is resolving to 0 because the variable you’re feeding it is either empty or keeps getting reset.
Make sure you do both of these:
-
Drive the slider from a stored variable:
- In the slider’s Pre-Selected Value field paste:
{"placeholder":"getvariable","values":{"name":"difficulty_value","default":"0"}} - That tells FancyMenu to pre-fill the slider with whatever
difficulty_valuecurrently holds (doc: Variables).
- In the slider’s Pre-Selected Value field paste:
-
Update that variable whenever the slider changes:
- In each branch of your action script (the
IF / ELSE-IF / ELSEblocks from before) add aSet Variable Value (FM Variable)action that writesdifficulty_value:$$value. This makes the variable keep the last selected index (doc: Action Scripts). - Confirm the variable actually changes by opening Customization → Variables → Manage Variables and watching its value after you move the slider.
- In each branch of your action script (the
If the slider still reverts to 0, check that nothing else is overriding difficulty_value (e.g., another action or layout load resetting it). Once the variable holds the last index and the slider reads it on load, the thumb will return to the previously saved step every time you reopen the menu.
This support thread has been marked as solved by @inner violet.
The AI helper is now disabled, but you can still continue the conversation if needed. Thank you for using our support system!