# NPCs & Holograms

> **Info:**
Everything on this page needs PhoenixNPCs or PhoenixHolograms on the same server. Both are picked up on their own, even when they load after this plugin, and nothing has to be set up.

## Currency Actions

Three action types are added to the click actions of PhoenixNPCs and PhoenixHolograms, so an NPC or a hologram can sell, reward or check for any currency. They show in the action builder of both editors.

| Action | Does |
| ------ | ---- |
| `[CURRENCY_GIVE] <currency> <amount>` | Gives the player the amount. |
| `[CURRENCY_TAKE] <currency> <amount>` | Takes the amount from the player. |
| `[CURRENCY_REQUIRE] <currency> <amount>` | Checks that the player has at least the amount, without taking it. |

The currency is its id and the amount accepts the [short forms](../plugin-information/commands.md#amounts), such as `[CURRENCY_TAKE] gems 50` or `[CURRENCY_GIVE] money 2.5k`.

When an action fails, the player is told why and the actions after it do not run: a take or a require the player cannot afford, or a give that would go past the [maximum balance](../main-features/currencies/edit-currency.md#maximum-balance). So put the take first and the reward after it. A player whose balances are still loading right after joining is asked to try again.

```yaml
- '[CURRENCY_TAKE] gems 50'
- '[COMMAND] console; give %player% diamond_sword 1'
- '[MESSAGE] &aEnjoy your sword!'
```

Changes made this way are logged in the [transaction log](transaction-log.md) with NPC or Hologram as the reason and the NPC's or hologram's id as who made them. An action with a currency that does not exist or a wrong amount is reported in the console, and the player is told something went wrong.

## Leaderboard Hologram

The Summon Leaderboard button of a currency's editor summons a PhoenixHolograms [leaderboard](../../phoenix-holograms/features/leaderboards.md) of that currency where you stand, already filled with its [top placeholders](../plugin-information/placeholders.md#leaderboards). It shows up to 10 rows, or the [leaderboard size](../main-features/leaderboards.md#leaderboard-size) when that is lower, and is named after the currency, such as `gems_leaderboard`.

<figure><img src="../.gitbook/assets/leaderboard/leaderboard-hologram.png" alt="" width="563"><figcaption><p>gems (Summon Leaderboard)</p></figcaption></figure>

It is a normal saved hologram from then on: change its look, rows and lines in `/pholo editor`. It needs only PhoenixHolograms, and the button is locked without it. Summoning turns the currency's leaderboard on if it was off. The header, row and your-balance formats it starts with are in the translation file.

Source: https://www.phoenixplugins.com/docs/phoenix-currencies/features/npcs-and-holograms