> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-event-system/entering-an-event.md).

# Entering an Event

Enter a CAS Event System event: use your ticket inside the event area, get approved by the host and join the private event instance.

## Using the ticket

Go to the event location and stand inside its area (the location's `coords` and `radius`). Use the **Event Ticket** from your inventory.

The ticket is checked against the next event at that location:

| Check                                                                          | If it fails                                                                                                                              |
| ------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| You are inside an event area                                                   | "You are not near any event area."                                                                                                       |
| An event is booked at this location                                            | "There is no event happening in this area right now."                                                                                    |
| The ticket belongs to this event                                               | "This ticket does not match the current event."                                                                                          |
| The doors are open: from 10 minutes before the start until 10 minutes after it | "The event has not started yet. There are X minutes left until it starts." or "The event has already started. You are too late to join." |

## Host approval

When `Config.CheckTicketByCreator` is `true` (the default), the host checks every ticket:

1. The host must be online and within 5 metres of the guest. Otherwise the guest gets "The event host is not available right now." or "You need to be near the event host to use this ticket."
2. The host gets "A player is showing you an event ticket." and sees the ticket card, with the guest's name, the date, the location and the event.
3. The host presses **Approve** or **Decline**. Both players are told which one it was.

With `Config.CheckTicketByCreator = false`, a valid ticket lets the guest in straight away.

## The private event area

An approved guest:

* is moved into the event's routing bucket (`Config.RoutingBucket`), a separate instance of the world with its own NPCs,
* gets "You have entered the event area!",
* has the ticket removed from their inventory.

Only players who entered with a ticket share this instance. Players outside it can't see them, and they can't see players outside.

The area is checked every 3 seconds. A guest who leaves the event radius is returned to the normal world and gets "You have left the event area."

{% hint style="info" %}
Hosts and staff who want to be inside the event enter the same way, with a ticket. With host approval on, the host approves their own ticket.
{% endhint %}
