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

# Animations

In most cases you'll be wanting to play an animation from server-side as that's where a majority of our logic is going to be written. There's a player function to do this with ease.

## Animation Flags

Animation flags are a way to specify how an animation looks in-game. They're built around bitwise functionality so you combine a handful of them to get the desired effect you want.

```typescript
export enum ANIMATION_FLAGS {
    NORMAL = 0,
    REPEAT = 1,
    STOP_LAST_FRAME = 2,
    UPPERBODY_ONLY = 16,
    ENABLE_PLAYER_CONTROL = 32,
    CANCELABLE = 120
}
```

Example

```typescript
const foreverLastFrame = ANIMATION_FLAGS.STOP_LAST_FRAME | ANIMATION_FLAGS.UPPERBODY_ONLY;
```

## Usage

Playing an animation can be done like this...

**Input Values**

```typescript
// Plays an animation forever.
Athena.player.emit.animation(player, 'dictionary', 'name', flags, -1);
```

**Example**

```typescript
// Plays for 12 seconds.
Athena.player.emit.animation(
    player,
    'mp_car_bomb',
    'car_bomb_mechanic',
    ANIMATION_FLAGS.NORMAL | ANIMATION_FLAGS.REPEAT,
    12000,
);
```

## Stopping Animation

If you ever find yourself needing to stop an animation there's a simple function to clear it.

```typescript
Athena.player.emit.clearAnimation(player);
```

## Scenarios

Scenarios are just really complex animations that are generally long.

[Scenario List](https://github.com/Santagain/gtav-scenarios)

```typescript
// Plays for 10 seconds.
playerFuncs.emit.scenario(player, `WORLD_HUMAN_AA_SMOKE`, 10000);
```


---

# 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:

```
GET https://stuykgaming.gitbook.io/old/player/animation.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.
