#Custom Clouds enable/disable button?

1 messages Β· Page 1 of 1 (latest)

little pulsar
dense bobcatBOT
#

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:

  1. Create a Variable:

    • Go to Customization -> Variables -> Manage Variables in the menu bar.
    • Add a new variable, for example, name it clouds_state.
    • Set its initial value to OFF.
  2. Create Your Button:

    • Add a new Button element to your desired layout.
  3. Configure the Button's Action Script:

    • Right-click your new button and select Edit Action Script.

    • You'll create an IF/ELSE-IF/ELSE structure here to check the clouds_state variable and set the Minecraft option accordingly.

    • IF clouds_state is "OFF":

      • Add an IF Statement.
      • Set its requirement to Is Variable Value.
      • The value for the requirement should be clouds_state:OFF.
      • Inside this IF block, add two actions:
        1. Set Variable Value: clouds_state:ON
        2. Edit Minecraft Option: Set the option named clouds to 2 (which is typically "Fast" for clouds).
    • ELSE-IF clouds_state is "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-IF block, add two actions:
        1. Set Variable Value: clouds_state:OFF
        2. Edit Minecraft Option: Set the option named clouds to 0 (which typically means "Off" for clouds).
    • This setup will make your button toggle between "ON" (clouds on Fast) and "OFF" (clouds off).

#
  1. Display the Button Label:
    • You can set your button's label to show the current state of your clouds_state variable.
    • Right-click the button and edit its label. You can use the Get Stored Variable placeholder:
      {"placeholder":"getvariable","values":{"name":"clouds_state"}}
      
      This will make the button display either "ON" or "OFF" based on the variable's value!

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! 😊

little pulsar
#

Can you show how that would look in the Script Body?

dense bobcatBOT
# little pulsar 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:

  1. Right-click your custom "Clouds" button in the layout editor.

  2. Select "Manage Action Script".

  3. Add the first IF block:

    • 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 click Done.
    • Inside this newly created IF block (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.
#
  1. Add the ELSE-IF block:
    • Select the IF block 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 click Done.
    • Inside this new ELSE-IF block (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.

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. 😊

little pulsar
#

It doesn't work, the clouds stay on even if it's turned to off.