# IEventSubscription

Kind: Interface · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0

<div class="api-meta">
<span class="api-kind api-kind-interface" data-pagefind-filter="kind:Interface">Interface</span>
<span data-pagefind-filter="namespace:Sansar.Script">Namespace <a href="/scripting/api/sansar.script"><code>Sansar.Script</code></a></span>
</div>

<span id="T:Sansar.Script.IEventSubscription"></span>

Token representing an event subscription.

```csharp
public interface IEventSubscription
```

## Remarks

Manages existing events.

## Members at a glance

| Kind | Members |
|---|---|
| **Properties** | [Active](#active) |
| **Methods** | [Unsubscribe](#unsubscribe) |

## Properties

### Active

<div class="api-card">
<span id="P:Sansar.Script.IEventSubscription.Active"></span>

```csharp signature
public bool Active { get; }
```

Is this subscription is still listening for events.

**Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — Will return false if this subscription has been unsubscribed or is not persistent and an event has been generated.

</div>


## Methods

### Unsubscribe

<div class="api-card">
<span id="M:Sansar.Script.IEventSubscription.Unsubscribe"></span>
<span id="M:Sansar.Script.IEventSubscription.Unsubscribe()"></span>

```csharp signature
public void Unsubscribe()
```

Removes this subscription.

<details class="api-remarks"><summary>Remarks</summary>

Events which have already been queued but not sent may be generated after this call.

</details>

</div>


## Used in examples

- [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs)
- [CommandExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CommandExample.cs)
- [CommandScreenshot.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CommandScreenshot.cs)
- [ScriptLibrary/LibraryBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/LibraryBase.cs)
- [ScriptLibrary/Scene/Collisions.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Collisions.cs)
- [ScriptLibrary/Scene/GrabRelease.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/GrabRelease.cs)
- [ScriptLibrary/Scene/HintText.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/HintText.cs)
- [ScriptLibrary/Scene/SitStand.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/SitStand.cs)
- [ScriptLibrary/Scene/TimedEvents.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/TimedEvents.cs)
- [ScriptLibrary/Scene/Visitors.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Visitors.cs)
- [TwitchEventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/TwitchEventExample.cs)

<p class="api-generated" data-pagefind-ignore>Generated from the Sansar 47.10.0 client ScriptApi snapshot.</p>