> For the complete documentation index, see [llms.txt](https://edseries-plugins.gitbook.io/p/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edseries-plugins.gitbook.io/p/edperks/essential/tickets.md).

# Perk Tickets

A **Perk Ticket** is the currency a roll consumes. Every roll costs exactly **one ticket**; no ticket, no roll.

Tickets are stored per player in EdPerks' own database (not as a physical item), alongside the roll and pity counters.

## Where tickets come from

| Source               | How                                                                                                                         |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **Starting balance** | New players begin with `tickets.starting` (default `0`) — see [config](/p/edperks/essential/main-configuration.md#tickets). |
| **Admin command**    | `/edperks tickets give <player> <amount>` (or `set`). See [Commands](/p/edperks/essential/commands.md).                     |
| **In-game store**    | The `[buy-tickets]` GUI action charges a host currency and credits tickets.                                                 |
| **API**              | `EdPerksAPI#addTickets(...)` for other plugins / webstores. See the [API](/p/edperks/developers/edperks-api.md).            |

## Checking a balance

* Players see their balance in the Tool Perks menu via `%edperks_tickets%`.
* Admins can check anyone with `/edperks tickets <player>`.

***

## Buying tickets in-game

The bundled `tool-perks.yml` menu shows three "buy" buttons that, by default, just link players to your webstore:

```yaml
'buy-1':
  material: 'ENDER_EYE'
  name: '&f1x | &b&lPerk Ticket'
  slots: '39'
  lore:
    - '&7Running low on Perk Tickets?'
    - '&7Grab more from our store!'
    - '&r'
    - '&e[&6CLICK TO VISIT THE STORE&e]'
  left-click-actions:
    - '[message] &dPurchase Perk Tickets at &fstore.myserver.com'
```

### Selling tickets for in-game currency

To let players buy tickets with a **host currency** instead, swap the `[message]` action for the `[buy-tickets]` action:

```yaml
  left-click-actions:
    - '[buy-tickets] <amount> <cost> <currency>'
```

* `<amount>` — how many tickets to grant,
* `<cost>` — how much currency to charge,
* `<currency>` — the host currency id to charge (e.g. `money`, `gems`).

For example, **5 tickets for 10,000 money**:

```yaml
  left-click-actions:
    - '[buy-tickets] 5 10000 money'
```

The charge is handled by the active host:

* **EdDungeons** — deducts the named currency via its currency API.
* **EdTools** — deducts the named currency if it exists.

On success the player is credited and gets the `tickets.purchased` message; if they can't afford it they get `tickets.not-enough-currency`. See [Action Types](/p/edperks/extra/action-types.md#buy-tickets) and the [host integration notes](/p/edperks/extra/host-integrations.md).

{% hint style="info" %}
The buy-button **item amounts** (e.g. `amount: 10`) are purely cosmetic — they show a stack of 10 in the menu. The number of tickets actually granted comes from the `[buy-tickets]` action's first argument.
{% endhint %}


---

# 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://edseries-plugins.gitbook.io/p/edperks/essential/tickets.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.
