#✅ | action delay
1 messages · Page 1 of 1 (latest)
Hi there! 👋
To achieve a delay before quitting the game, you can't directly add a "wait" action in FancyMenu, as this would freeze your game. However, you can use a Ticker element in combination with FancyMenu's variables and an IF statement to create a delay.
Here's how you can set it up:
-
Create a New Variable:
- Go to Customization -> Variables -> Manage Variables in the menu bar.
- Add a new variable, for example,
quit_timer, and set its initial value to0.
-
Create a Custom GUI for Your "Quitting" Screen:
- Go to Customization -> Custom GUIs -> Manage Custom GUIs and create a new custom GUI for your message. You can find more details on how to do this here: Custom GUIs
- Design this screen with your custom message or animation. Let's call its identifier
quitting_message_screen.
-
Set Up a Ticker Element on Your Custom GUI:
- Open your
quitting_message_screenin the layout editor. - Add a Ticker element to your layout.
- Configure the Ticker:
- Set its Tick Mode to
Normal. - Set its Tick Delay to a small value, e.g.,
50milliseconds (this means it ticks 20 times per second, so 20 "timer" counts per second).
- Set its Tick Mode to
- Open your
- Add Actions to the Ticker (Edit Action Script):
* Action 1 (Set Variable Value): Add an actionset_variableto increment yourquit_timervariable. Use the Calculator placeholder for this:
quit_timer:{"placeholder":"calc","values":{"expression":"{"placeholder":"getvariable","values":{"name":"quit_timer"}} + 1","decimal":"false"}}
* Action 2 (IF Statement): Add anIFstatement.
* Condition: Use the Is Number requirement to check ifquit_timerhas reached your desired delay (e.g.,40for a 2-second delay if your ticker ticks every 50ms).
* Value:{"placeholder":"getvariable","values":{"name":"quit_timer"}}
* Compare Mode:bigger-than-or-equals
* Compare With:40(or your desired count for the delay)
* Action inside IF: If the condition is met, add thequitgameaction.
- Change Your Original "Quit" Button to Open the Custom GUI:
- Locate the button that was originally set to quit the game.
- Change its action script. Instead of
quitgame, use theopenguiaction to open yourquitting_message_screen.
This setup will ensure that when you click the "quit" button, your custom message screen appears, a timer counts up in the background, and once the timer reaches your specified value, the game quits.
Let me know if this helps! 😊
in the if statement value, what do i put in number and compare to number? my desired delay before the game quits is ideally 3 seconds
Okay, for a 3-second delay, you would configure the "Is Number" requirement within your Ticker's IF statement like this:
- Number:
{"placeholder":"getvariable","values":{"name":"quit_timer"}}(This always checks the current value of yourquit_timervariable.) - Compare Mode:
bigger-than-or-equals - Compare With: For a 3-second delay, since your Ticker ticks every 50ms (20 times per second), you'd want
60(3 seconds * 20 ticks/second).
So, the full condition for the "Is Number" requirement would be:
["mode":"bigger-than-or-equals","number":"{"placeholder":"getvariable","values":{"name":"quit_timer"}}","compare_with":"60"]
This means the quitgame action will trigger once your quit_timer variable reaches or exceeds 60, effectively creating a 3-second delay! ✨
so do i put 60 as well in the ticker's tick delay properties?
No, please don't put 60 as the Ticker's tick delay! That would make each "tick" 60 milliseconds long. 😉
The Tick Delay should remain at a low value like 50ms (or even 25ms for more precision, but that might increase performance load) so that the quit_timer variable counts up frequently.
The 60 we discussed is the target value for your quit_timer variable (which gets incremented every 50ms) to hit before the game quits, not the delay between each tick of the Ticker itself.
So, to summarize:
- Ticker Tick Delay: Keep it at
50ms. - IF Statement "Compare With" Value: Set it to
60(for a 3-second delay, with a 50ms tick delay).
Let me know if that makes sense! 💖
okay so now how to i add the action inside IF?
That's a great question! It's a common point of confusion since the interface can be a bit subtle there.
When you're in the "Manage Action Script" screen for your Ticker element:
- Add the
quitgameaction first, just like you would add any other action. It will appear at the bottom of your action list. - Drag and Drop: Now, grab the just-added
quitgameaction (by clicking and holding on it) and drag it slightly upwards. You'll see a visual indicator (like a line or a highlight) appear to show you where you can place it. - Nest it under the IF statement: Drag the
quitgameaction directly under yourIF Statementbut slightly indented. Release the mouse button when you see it snap into place, indented beneath theIFcondition.
This indentation indicates that the quitgame action is now a "child" of the IF statement and will only execute if the IF condition (your timer reaching 60) is met.
You can do the same for ELSE IF and ELSE statements if you were using those too!
Let me know if you encounter any difficulties with the drag-and-drop. 😊
so basically my action scripts should be in this order:
- set variable value
- IF statement
- quit minecraft
Not quite! The quit_minecraft action needs to be inside the IF statement.
Your action script for the Ticker element should look structurally like this:
▶ Action Script
│
├─■ Set Variable Value: quit_timer:{"placeholder":"calc","values":{"expression":"{"placeholder":"getvariable","values":{"name":"quit_timer"}} + 1","decimal":"false"}}
│
└─▶ IF (Is Number: quit_timer >= 60)
└─■ Quit Minecraft
So, when you see it in the "Manage Action Script" editor, the "Quit Minecraft" action should be visibly indented under the "IF" statement. This nesting is crucial for it to only execute when the condition is met.
Does that clarification help visualize it better? 💖
sorry yes thats what i meant.
-actionscript (parent action)
-if statement (parent action)
-quitgame (sub action)
Ah, I understand now! My apologies for misunderstanding. It sounds like you've got the hierarchy right in your head.
Yes, that's exactly correct! Your Ticker's action script should have the Set Variable Value action as one main step, and then the IF Statement as another main step. Inside that IF Statement, the Quit Minecraft action should be a sub-action.
So:
Set Variable Value(direct child of the main Action Script block)IF Statement(direct child of the main Action Script block)Quit Minecraft(child of theIF Statementblock)
This structure ensures the Quit Minecraft action only runs after the timer variable reaches the threshold. You're doing great! 💖
wait its not quitting
Oh no! Let's figure out why it's not quitting. 🤔
To help me understand what might be going on, could you please provide a bit more information?
- Can you describe exactly what happens when you expect it to quit? Does nothing happen at all, or does the screen just stay open indefinitely?
- Is your
quitting_message_screenactually opening? (The screen you designed with your custom message). - Are you seeing the
quit_timervariable incrementing? You can check this by displaying the variable's value on your custom screen using a Text element with the placeholder{"placeholder":"getvariable","values":{"name":"quit_timer"}}. - Could you please describe the exact steps you took? Sometimes a small detail in the setup can make a big difference.
No worries, we'll get it working! 😊
my gui opened but no my variable stayed at zero.
so first i added a variable that is set to 0
i made the gui and i added the ticker element, set it to normal with 50ms tick delay. i edited the action scripts the way we discussed it. i went back to my old quit gui to change the action script for the button to open the quitting message gui. i tested it out, it doesnt seem to perform the quitting action
Hmm, the variable staying at zero is a key piece of information! That tells us the issue is with the Ticker itself or the "Set Variable Value" action within it.
Here's what we need to check:
-
Is the Ticker element active on your
quitting_message_screen?- Sometimes elements might have loading requirements that prevent them from activating. Right-click your Ticker element in the editor and check its "Loading Requirements". Is there anything set there that might be preventing it from running? For this purpose, it typically shouldn't have any, or very simple ones.
-
Double-check the "Set Variable Value" action:
- Go back to the Ticker's action script.
- Find the
set_variableaction you added. - Ensure the value is exactly:
quit_timer:{"placeholder":"calc","values":{"expression":"{"placeholder":"getvariable","values":{"name":"quit_timer"}} + 1","decimal":"false"}} - Make absolutely sure there are no typos, extra spaces, or missing characters (like a bracket) in this string. The nested placeholders can be quite sensitive.
- Also, ensure this
set_variableaction is a direct child of the Ticker's action script (at the same level as theIFstatement, not nested inside it).
-
Is your
quit_timervariable named exactlyquit_timer?- Go back to Customization -> Variables -> Manage Variables and confirm the exact spelling and capitalization of
quit_timer. It must match precisely in the action script.
- Go back to Customization -> Variables -> Manage Variables and confirm the exact spelling and capitalization of
If you like, feel free to share a screenshot of your Ticker's "Manage Action Script" screen in Discord. That might help me spot any small details. 😊
Let's get this counter ticking!
i think it works now. but now how do i customize the gui again without it closing my game T-T
Yay, that's progress! 🎉 Glad to hear it seems to be working!
You've hit a super common point now regarding testing. It's indeed annoying to keep quitting your game.
Here's how you can safely customize your quitting_message_screen without the game closing:
-
Temporarily Remove the
Quit MinecraftAction:- Go back to the layout editor for your
quitting_message_screen. - Right-click your Ticker element.
- Go to "Edit Action Script."
- Find the
Quit Minecraftaction (which is nested under yourIFstatement). - Click on it and select "Remove Action."
- Save the layout (
Ctrl+S).
- Go back to the layout editor for your
-
Now Customize Freely:
- With the
Quit Minecraftaction removed, your custom GUI can stay open as long as you need while you tweak elements, move things around, or refine its appearance. The Ticker will still run and increment the variable, but it won't actually close the game.
- With the
-
Restore When Done:
- Once you're satisfied with the look and feel of your
quitting_message_screen, go back into the Ticker's "Edit Action Script." - Add the
Quit Minecraftaction again, ensuring it's nested correctly under yourIFstatement. - Save the layout one last time.
- Once you're satisfied with the look and feel of your
This way, you get the best of both worlds: easy customization and functional logic! 👍
i cant even open it because when i open it through manage gui, my game automatically quits
Oh dear, you are absolutely right! My apologies, that was an oversight on my part. 😓 The way you have it set up, opening it directly would trigger the quit action.
Here's the correct way to safely edit that specific GUI:
- Stop Minecraft immediately. Don't try to open your
quitting_message_screenagain in-game. - Navigate to your Minecraft instance folder. This is where your
.minecraftfolder or modpack instance is located. - Go to
config/fancymenu/customization. - Find the layout file for your
quitting_message_screen. It will be a.txtfile, likely named after your custom GUI's identifier (e.g.,quitting_message_screen.txt). - Open this
.txtfile with a plain text editor (like Notepad on Windows, TextEdit on macOS, or VS Code). - Locate and remove the
Quit Minecraftaction lines.- You'll be looking for a section related to your Ticker element. Inside that, find the
action = quitgameline. - Crucially, also remove the
action_type = quitgameline and the corresponding{ }block it's inside if it has any additional parameters. - It might look something like this (exact lines may vary):
# ... other Ticker properties ... action_executable_blocks { block { type = if_statement # ... other if statement properties ... actions { # This is the part you need to remove action { action = quitgame # ... other quitgame properties if any ... } } } } # ... rest of the file ... - Make sure to remove the
action = quitgameline and anything directly linked to it. The goal is to temporarily disable the quit action.
- You'll be looking for a section related to your Ticker element. Inside that, find the
- Save the
.txtfile. - Restart Minecraft.
- Now, when you open FancyMenu, you should be able to open your
quitting_message_screenvia Customization -> Custom GUIs -> Manage Custom GUIs -> Open GUI without the game immediately closing.
Once you've made all your visual adjustments in the editor, remember to re-add the Quit Minecraft action to your Ticker's action script in the editor, save the layout again, and you'll be all set!
Thank you for catching that! Let me know if you need more precise instructions for editing the text file.
okay i made it work now, thanks so much alice
You are so very welcome, Azra! I'm genuinely delighted I could help you get it all sorted out. Sometimes those little tricky bits can be a real head-scratcher! 🤯
Don't hesitate to reach out if you have any more questions or run into anything else. I'm always here to assist! Happy customizing! ✨
This support thread has been marked as solved by @echo epoch.
The AI helper is now disabled, but you can still continue the conversation if needed. Thank you for using our support system!
✅ | action delay