# NFT Sensor

{% hint style="success" %}
**COPY/PASTE PARAMETERS**

New in GM 0.11! Right click on a behaviour or component to copy. Then open an object, add the same behaviour or component, and right click it to paste identical parameter settings.
{% endhint %}

<figure><img src="https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2FmiGYPqCDx3bwTu4AmuTH%2FNFT%20Sensor.webp?alt=media&#x26;token=dd186009-6170-4394-b70e-d59075c1cfa4" alt=""><figcaption><p>In the image above, the NFT Sensor component's success message triggers a <a href="broken-reference"><strong>popup window created in Rules</strong></a> to inform the player of the perks gained from holding the required NFT. It also triggers a Rule to add 150 to the player's <a href="../../../creative-guides/game-rules-guide/shop"><strong>Play Coins</strong></a> mechanic. The door opens for all players, but the one who opens it gets the bonus perks in this logic setup.</p></figcaption></figure>

<table data-card-size="large" data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><img src="https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2FVie1mnKUfb3v9bLiwN4P%2Fimage.png?alt=media&#x26;token=eebd41d2-0248-4854-824c-bd2dae13bc8e" alt="" data-size="original"></td></tr><tr><td><p>If the player does not have all of the required NFTs in their wallet, a window can be set to pop up and show which NFT(s) are required to trigger a success message, including a Marketplace link.</p><p></p><p>Note: The window does not filter out which NFTs the player already owns.</p></td></tr></tbody></table>

{% hint style="info" %}
[build-singleplayer-and-multiplayer-logic](https://docs.sandbox.game/en/creator/game-maker/docs/build-singleplayer-and-multiplayer-logic "mention") - about <mark style="color:green;">**\[SP]**</mark> or <mark style="color:yellow;">**\[MP]**</mark> behaviours or components
{% endhint %}

{% hint style="success" %}
**SECRET BENEFITS FOR NFT HOLDERS**\
To give players access to secret areas, hidden quests, and other bonuses for owning a specified NFT, use the [**Teleport**](https://docs.sandbox.game/en/creator/game-maker/docs/components/actions/avatar-teleport) component to move players who trigger the success message with the \[MP] NFT Sensor component.
{% endhint %}

## <img src="https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2FDAQm7e737FocYXPRciSW%2Fimage.png?alt=media&#x26;token=76c036d8-c3cd-4c80-906e-979ba0a68d48" alt="" data-size="line"> NFT Sensor <mark style="color:yellow;">\[MP]</mark>

The NFT Sensor Component is a powerful tool to detect one or more NFTs in the player's wallet and send a success or failure message to create a variety of results.

There are two methods to detect NFTs:

* Specify Sandbox NFTs (using the Asset URL from The Sandbox website)
* Select NFT collections (and in 0.11, you can require certain traits within a collection for success)
* Require that the player has specified NFTs equipped ([**see equipment use cases**](https://docs.sandbox.game/en/creator/game-maker/creative-guides/logic-guide/equipment-based-logic-on-equip-nft-sensor))

Use the condition toggle to require ownership of all NFTs/collections specified or at least one of them.

Send a message to trigger various logic to reward NFT holders.

## Common Uses

{% hint style="info" %}
See [**Potential Use Cases for Monetisation**](#potential-use-cases-for-monetisation) below for logic that may be used to create limited access gameplay for NFT holders who trigger the success message.
{% endhint %}

Monetise premium content in your Experience by gating access to it through NFT ownership.

Grant holders of the NFTs you specify special access to:

* Exclusive areas of an Experience
* Unlocked quests or narratives
* Bonus Power Ups
* Perks via game mechanics created in Game Rules
* and more

## Communications

|                              |                                                            |
| ---------------------------- | ---------------------------------------------------------- |
| **Input:** multiple messages | **Output:** success message or fail message (customisable) |

## Applying NFT Requirements

{% hint style="info" %}
For the first version of the NFT Sensor component, you may only have one NFT and one Collection as the success/failure criteria using and/or logic.
{% endhint %}

{% tabs %}
{% tab title="By NFT" %}

### Add an NFT Token ID

1. Click on **NFT Token ID** in the NFT Sensor Component. A window will open where you must add an **Asset URL**.
2. Open an Asset's page on The Sandbox website (from [**your inventory**](https://www.sandbox.game/en/me/inventory/?sections=0) or by [**searching the Marketplace**](https://www.sandbox.game/en/shop/)) and copy the URL. See the image below for an example.
3. Return to Game Maker and paste the URL into the **Asset URL** box. Click **Validate** and then **Continue**.&#x20;

You can add more and set the **AND/OR** condition as you wish.

<figure><img src="https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2Fzft2DHDVgYBLfln2ES1M%2FGM%200.9%20NFT%20Sensor%20TSB%20URLs.png?alt=media&#x26;token=b5c65930-c370-4c88-b58a-9a6167ba6eeb" alt=""><figcaption><p>Find the <strong>Asset URL</strong> on The Sandbox website</p></figcaption></figure>
{% endtab %}

{% tab title="By Collection" %}

### Add a Collection

{% hint style="warning" %}
**INFORM PLAYERS TO EQUIP AVATARS**

Simply owning an Avatar from a collection integrated with NFT Sensor will not trigger the success message. The avatar must be equipped when triggering the NFT Sensor.

Use your [**Experience Page**](https://docs.sandbox.game/en/creator/game-maker/publish-experiences/experience-manager/experience-page) to inform players to equip their Avatars before they start the Experience. It is currently not possible to change Avatars and resume play.
{% endhint %}

Use the dropdown menu to select an existing Avatar collection on The Sandbox Marketplace.

{% hint style="info" %}
For the first version of the NFT Sensor component, available collections only include Avatars on The Sandbox Marketplace.
{% endhint %}
{% endtab %}
{% endtabs %}

## Parameter Notes

New parameters in 0.11 allow you to:

* Add a purpose and description (which does not affect game logic, but helps you keep track of your game design intent)
* Only trigger a success message if one or more required NFTs are equipped
* Add a collection and limit the sensor success only to specified traits
* AND/OR condition can apply to multiple individual NFT token IDs and multiple collections (or collections with trait filters)

<figure><img src="https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2FzBCD1qifMlkS3kCDJWsz%2Fimage.png?alt=media&#x26;token=5ddf038d-cdda-4730-8c61-3fc321ad8433" alt="" width="321"><figcaption></figcaption></figure>

<figure><img src="https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2FE2alT4eLuT98qmYiJrWo%2Fimage.png?alt=media&#x26;token=53b4d633-957c-4ad0-b27f-d17d428c5502" alt="" width="334"><figcaption></figcaption></figure>

## :brain::thunder\_cloud\_rain: Potential Use Cases for Varied Gameplay & Monetisation

This is by no means an exhaustive list of what's possible with the NFT Sensor component. It's merely a starting point. Keep visiting the Creator Portal as we document new methods of leveraging the NFT Sensor for creative gameplay variations and monetisation.

### **Open a Door for All Players**

Trigger a \[MP] [**Door**](https://docs.sandbox.game/en/creator/game-maker/docs/behaviours/movement/door) behaviour so the NFT holder can help all players in the Experience get through. Require a different NFT to open each door in a maze for a fun community challenge.

### **Teleport to VIP Areas & Gameplay**

Trigger the new \[MP] [**Teleport**](https://docs.sandbox.game/en/creator/game-maker/docs/components/actions/avatar-teleport) component to transport the NFT holder to an exclusive area. There, players can trigger extra [**quests**](https://docs.sandbox.game/en/creator/game-maker/docs/objectives), [**Power Ups**](https://docs.sandbox.game/en/creator/game-maker/docs/components/status/power-up), gameplay mechanics built from [**Game Rules**](https://docs.sandbox.game/en/creator/game-maker/docs/game-rules), and more!

### **Teleport Players to Create Teams**

Use the [**Teleport**](https://docs.sandbox.game/en/creator/game-maker/docs/components/actions/avatar-teleport) component to split players into different parts of an Experience with a timed challenge using the [**Game Rules**](https://docs.sandbox.game/en/creator/game-maker/docs/game-rules) system or [**Crowd Event**](https://docs.sandbox.game/en/creator/game-maker/docs/behaviours/basic-logic/crowd-event) behaviour to see which team can finish first! Create a different theme or art style for each team's playable space to appeal to different player interests. Even better, match the theme of the space with the NFT they need to own.

### **Gain a Competitive Edge**

Spawn a [**Collectable**](https://docs.sandbox.game/en/creator/game-maker/docs/components/actions/collectable) item for a [**Power Up**](https://docs.sandbox.game/en/creator/game-maker/docs/components/status/power-up), resources needed to make progress in your gameplay, or equipment to enhance the player's stats. To ensure that only the NFT holder gets these competitive bonuses, teleport them to a secret location to collect these items and then return them to the fray.&#x20;

In a parkour challenge, you could [**teleport**](https://docs.sandbox.game/en/creator/game-maker/docs/components/actions/avatar-teleport) NFT holders to shortcuts that lead back to the same course they're racing with other players.

### **Cause Multiplayer Mayhem**

Let NFT holders:

* Change the game world through the [**Actor Property Switcher**](https://docs.sandbox.game/en/creator/game-maker/docs/behaviours/modifiers/actor-property-switcher), [**Post Process Effects**](https://docs.sandbox.game/en/creator/game-maker/docs/behaviours/visual/post-process-effects) (camera), [**Visual FX**](https://docs.sandbox.game/en/creator/game-maker/docs/components/display/visual-fx), and [**Weather Switcher**](https://docs.sandbox.game/en/creator/game-maker/docs/behaviours/visual/weather-switcher) behaviours.
* Trigger [**Asset Spawners**](https://docs.sandbox.game/en/creator/game-maker/docs/behaviours/modifiers/asset-spawner) to make [**Collectable**](https://docs.sandbox.game/en/creator/game-maker/docs/components/actions/collectable) [**Power Up**](https://docs.sandbox.game/en/creator/game-maker/docs/components/status/power-up) items appear that anyone can use.
* Turn on and off [**Basic**](https://docs.sandbox.game/en/creator/game-maker/docs/behaviours/movement/basic-platform) and [**Advanced Platforms**](https://docs.sandbox.game/en/creator/game-maker/docs/behaviours/movement/advanced-platform) with the [**Toggle Behaviour** ](https://docs.sandbox.game/en/creator/game-maker/docs/components/status/toggle)component.
* Progress the [**Crowd Event**](https://docs.sandbox.game/en/creator/game-maker/docs/behaviours/basic-logic/crowd-event) meter and give all players or those in range fun [**trailing Visual FX**](https://docs.sandbox.game/en/creator/game-maker/docs/display/visual-fx#aura-trail).

### Enjoy Bonus Game Mechanics

Trigger [**Game Rules**](https://docs.sandbox.game/en/creator/game-maker/docs/game-rules) that apply only to the NFT holder by using [**local variables**](https://docs.sandbox.game/en/creator/game-maker/game-rules#variable-types-1) (L) in Rules.&#x20;

While \[SP] and \[MP] logic layers can NOT communicate with each other, they can both communicate with the Game Rules system!&#x20;

As long as a player triggers the message to be sent (even if it's the start of a long chain of logic), the **player source** will be included in the message so the Game Rules system can modify only that player's local variable. Use this to give NFT holders bonus currency for your game world's shops, extra points, bonus time, and more.


---

# Agent Instructions: 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://docs.sandbox.game/en/creator/game-maker/docs/components/nft/nft-sensor.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.
