> For the complete documentation index, see [llms.txt](https://pm2plugins.gitbook.io/infinitegui/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pm2plugins.gitbook.io/infinitegui/features/scenes.md).

# Scenes

A GUI can have multiple "scenes" to create animations or timed transitions. Scenes cycle through in order, each after its specified delay.

```yaml
codescenes:
  '0':
    delay: 0
    items:
      '1':
        slot: 13
        item: DIAMOND_SWORD
        amount: 1
        item-name: "&bEpic Sword"
        item-lore:
          - "&7Powerful blade"
        item-flags: [all]
        unbreakable: false
        custom-model-data: 123
        # conditions and click-events here
```

* Scenes are indexed by strings (`'0'`, `'1'`, etc.).
* `delay`: Time in ticks after previous scene before showing this scene. 20 ticks = 1 second.
* `items`: Defines GUI slots and their contents.

<figure><img src="/files/jF4pymgZ2Ik5Wz9Slby5" alt=""><figcaption><p>Quick Scene Example</p></figcaption></figure>

<div><figure><img src="/files/thHAmiSdNcHe9AO4nT0M" alt=""><figcaption><p>Scene 0</p></figcaption></figure> <figure><img src="/files/5EdIcVnpFNoPFGtHmqA7" alt=""><figcaption><p>Scene 1</p></figcaption></figure> <figure><img src="/files/4A4ZVE9jPmGRDROBkbyB" alt=""><figcaption><p>Scene 2</p></figcaption></figure> <figure><img src="/files/1qHCwPvxfzYoNYPv2e1N" alt=""><figcaption><p>Scene 3</p></figcaption></figure></div>

<figure><img src="/files/pR6kRz6jj0fIeR6zCnLz" alt=""><figcaption><p>Scene Menu</p></figcaption></figure>

Scenes also allow for an additional action to be made with the Event Manager.

<figure><img src="/files/kQyhgUU65CkOiSXeoPF4" alt=""><figcaption></figcaption></figure>

With the Event Manager, you are able to set up numerous events such as:

* Message Player
* Run a command for the Player
* Send a title to player
* Close Open Inventory
* Give Money
* Remove Money
* Set Money
* Chat Fetcher
* Player Picker Command Executor (with an ability to attach a command)
* Give custom item to player
* Save information per player
* Offline Player Picker Command Executor (with an ability to attach a command)

A perfect example is Run a command for the player, where the scenes feature makes opening any menu (in our example a shop menu) extraordinary.

<div data-full-width="true"><figure><img src="/files/L6YcryVJuqTwa6ft4Uqw" alt=""><figcaption></figcaption></figure></div>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pm2plugins.gitbook.io/infinitegui/features/scenes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
