Skip to content

Commit 6c91ed3

Browse files
authored
Merge pull request #237 from BerkieBb/main
feat(ox_lib): playAnim
2 parents 9acd263 + a275164 commit 6c91ed3

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Client
2+
3+
## lib.playAnim
4+
5+
Plays an animation with the given arguments. This function also automatically loads and unloads the given animation dictionary so you don't have to manage that.
6+
This function can directly replace TaskPlayAnim.
7+
8+
```lua
9+
lib.playAnim(ped, animDictionary, animationName, blendInSpeed, blendOutSpeed, duration, animFlags, startPhase, phaseControlled, controlFlags, overrideCloneUpdate)
10+
```
11+
12+
- ped: `number`
13+
- The ped that will play the animation
14+
- animDictionary: `string`
15+
- The animation dictionary.
16+
- animationName: `string`
17+
- The name of the animation within the dictionary.
18+
- blendInSpeed?: `number`
19+
- The speed to blend in the animation with.
20+
- Default: `8.0`
21+
- blendOutSpeed?: `number`
22+
- The speed to blend out the animation with.
23+
- Default: `8.0`
24+
- duration?: `number`
25+
- The amount of milliseconds the animations will take. -1 to play until cancelled.
26+
- Default: `-1`
27+
- animFlags?: `AnimationFlags`
28+
- The animation flags. You can find these [here](https://github.com/overextended/ox_lib/blob/master/imports/playAnim/client.lua#L1-L33)
29+
- Default: `0`
30+
- startPhase?: `number`
31+
- At what percentage of the animation it should start at. (Number between 0.0 and 1.0)
32+
- Default: `0.0`
33+
- phaseControlled?: `boolean`
34+
- Whether the startPhase is used.
35+
- Default: `false`
36+
- controlFlags?: `ControlFlags`
37+
- Flags to manipulate how the character is controlled by the animation. You can find these [here](https://github.com/overextended/ox_lib/blob/master/imports/playAnim/client.lua#L35-L50)
38+
- Default: `0`
39+
- overrideCloneUpdate?: `boolean`
40+
- When true, other clients can't see the animation playing on the ped, even if the ped is not the client itself.
41+
- Default: `false`

0 commit comments

Comments
 (0)