Add Lag Time to a Button
Adding lag time to a code button transforms it into a “one-click” button – it doesn’t require a second click to end the instance. Instead, the instance will be closed automatically, a specified number of seconds after the button is activated.
Enter Edit mode in your code window.
Open the Inspector for a code button.
You can open the inspector by double-clicking the button or single-clicking it and then clicking the Inspector button in the code window toolbar.
Enter the Behaviour tab and check the box next to Lag time.
Enter (in seconds) your desired lag time.
When you’ve added lag time, you will always have a lead time, even if that lead time is just 0 seconds.