#Custom Clouds enable/disable button?
1 messages Β· Page 1 of 1 (latest)
Hey there! π I can definitely help you create a custom button to toggle your clouds setting.
You can achieve this with a Button element and a FancyMenu Variable. Here's how:
-
Create a Variable:
- Go to
Customization -> Variables -> Manage Variablesin the menu bar. - Add a new variable, for example, name it
clouds_state. - Set its initial value to
OFF.
- Go to
-
Create Your Button:
- Add a new Button element to your desired layout.
-
Configure the Button's Action Script:
-
Right-click your new button and select
Edit Action Script. -
You'll create an
IF/ELSE-IF/ELSEstructure here to check theclouds_statevariable and set the Minecraft option accordingly. -
IF
clouds_stateis "OFF":- Add an
IF Statement. - Set its requirement to
Is Variable Value. - The value for the requirement should be
clouds_state:OFF. - Inside this
IFblock, add two actions:Set Variable Value:clouds_state:ONEdit Minecraft Option: Set the option namedcloudsto2(which is typically "Fast" for clouds).
- Add an
-
ELSE-IF
clouds_stateis "ON":- Add an
ELSE-IF Statement. - Set its requirement to
Is Variable Value. - The value for the requirement should be
clouds_state:ON. - Inside this
ELSE-IFblock, add two actions:Set Variable Value:clouds_state:OFFEdit Minecraft Option: Set the option namedcloudsto0(which typically means "Off" for clouds).
- Add an
-
This setup will make your button toggle between "ON" (clouds on Fast) and "OFF" (clouds off).
-
- Display the Button Label:
- You can set your button's label to show the current state of your
clouds_statevariable. - Right-click the button and edit its label. You can use the
Get Stored Variableplaceholder:This will make the button display either "ON" or "OFF" based on the variable's value!{"placeholder":"getvariable","values":{"name":"clouds_state"}}
- You can set your button's label to show the current state of your
You can find more detailed information on action scripts, variables, and Minecraft options in these documentation pages:
Let me know if you have any more questions! π
Can you show how that would look in the Script Body?
Aha, I understand! You'd like to see the action script in a more structured format. While I can't directly show you a screenshot of the in-game script editor here, I can provide the logical flow of the actions and statements as you would configure them. Think of this as the step-by-step instruction for setting it up in the "Manage Action Script" screen.
Hereβs how the action script for your toggle button would be structured:
βΆ Action Script Block (for your "Clouds" button)
β
βββΆ IF Statement (Condition: Is Variable Value -> clouds_state:OFF)
β β (This block runs if the current cloud state is "OFF")
β β
β βββ Set Variable Value (FM Variable)
β β Value required: clouds_state:ON
β β
β βββ Edit Minecraft Option
β Value required: clouds:2
β
βββΆ ELSE-IF Statement (Condition: Is Variable Value -> clouds_state:ON)
β β (This block runs if the current cloud state is "ON")
β β
β βββ Set Variable Value (FM Variable)
β β Value required: clouds_state:OFF
β β
β βββ Edit Minecraft Option
β Value required: clouds:0
β
ββ (End of Action Script)
Breaking it down for how to set it up in FancyMenu:
-
Right-click your custom "Clouds" button in the layout editor.
-
Select "Manage Action Script".
-
Add the first
IFblock:- Click the "Add IF Statement" button.
- It will prompt you to add a requirement. Choose "Is Variable Value".
- Click "Edit Requirement Value" and type
clouds_state:OFF. Then clickDone. - Inside this newly created
IFblock (select it, then click "Add Action"):- Add a "Set Variable Value (FM Variable)" action.
- Click "Edit Action Value" and type
clouds_state:ON. - Add an "Edit Minecraft Option" action.
- Click "Edit Action Value" and type
clouds:2.
- Add the
ELSE-IFblock:- Select the
IFblock you just created. - Click "Append ELSE-IF Statement".
- It will prompt you to add a requirement. Choose "Is Variable Value".
- Click "Edit Requirement Value" and type
clouds_state:ON. Then clickDone. - Inside this new
ELSE-IFblock (select it, then click "Add Action"):- Add a "Set Variable Value (FM Variable)" action.
- Click "Edit Action Value" and type
clouds_state:OFF. - Add an "Edit Minecraft Option" action.
- Click "Edit Action Value" and type
clouds:0.
- Select the
This structure ensures that when you click the button, it first checks if clouds are "OFF". If they are, it turns them "ON" (Fast) and updates the variable. If they are already "ON", it turns them "OFF" and updates the variable.
Hope this visual representation helps you configure it! Let me know if you need anything else. π
It doesn't work, the clouds stay on even if it's turned to off.