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

# Events

LuckPerms events are just like normal Skript events: You plop them into your script and use the event-values (if you want).\
\
Below are a few examples of using some of the events in Skript-LuckPerms.

#### User Receive Permission

```genie
on user receive permission:
    set {_p} to event-player # note that its a player & not a user to prevent needless loading
    set {_perm} to event-permission
    set {_timespan} to event-timespan
    if {_timespan} is 0 seconds:
        broadcast "%{_p}% just got %{_perm}%!"
    else:
        broadcast "%{_p}% just got %{_perm}% for %{_timespan}%!"
```

#### Group Meta Set

```genie
on group meta set:
    set {_key} to event-key
    set {_value} to event-value
    if {_key} is "prefix":
        broadcast formatted "%event-player%'s prefix was just updated to %{_value}%<reset>!"
```

#### Track Add Group

```genie
on track add group:
   set {_track} to event-track
   set {_group} to event-group
   broadcast "%{_group}% was just added to %{_track}%!"
```

#### User Demote

```genie
on user demote:
    set {_player} to event-player # note that its a player & not a user to prevent needless loading
    set {_pastgroup} to past event-group
    set {_group} to event-group
    set {_track} to event-track
    broadcast "%{_player}% was just demoted from %{_pastgroup}% to %event-group% on track %{_track}%!"
```

See <https://skdocs.org/?query=event&addon=skript-luckperms> and set the filter to 'events' to get a list of all events in Skript-LuckPerms.


---

# 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, and the optional `goal` query parameter:

```
GET https://skript-luckperms.gitbook.io/skript-luckperms/events.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
