playanim
The playanim script command is used to play an animation for an entity.
Usage
playanim [-123lnpe] <animslot> [e?command...]
playanim [-123p] none
Context: Any Entity
Flags:
-1: Set the animation for the first animation layer - this is the default
-2: Set the animation for the second animation layer
-3: Set the animation for the third animation layer
-l: Loop the animation
-n: Do not interpolate from the current animation
-p: Set an animation on the player instead of the calling entity
-e: Execute a command after the animation completes
Parameters:
| Parameter | Type | Description |
|---|---|---|
animslot |
string |
The animation slot to kill |
command (requires -e) |
command |
A command to execute after the animation completes |
ℹ️ The delayed command specified using the -e flag is added as a hidden which can be cancelled using timer kill_local if playanim was called from the entity instance script. If the animation is cancelled the command will still be executed at the time the animation would have finished.
Animation slots
The animation for each slot is set using loadanim.
The following animation slots are supported:
waitwait2walkwalk1walk2walk3walk_backwardwalk_ministepwait_shortwalk_sneakactionaction1action2action3action4action5action6action7action8action9action10hit1hithold_torchhit_shortstrike1strikeshield_startshield_cycleshield_hitshield_endstrafe_rightstrafe_leftstrafe_run_leftstrafe_run_rightdiedagger_ready_part_1dagger_ready_part_2dagger_unready_part_1dagger_unready_part_2dagger_waitdagger_strike_left_startdagger_strike_left_cycledagger_strike_leftdagger_strike_right_startdagger_strike_right_cycledagger_strike_rightdagger_strike_top_startdagger_strike_top_cycledagger_strike_topdagger_strike_bottom_startdagger_strike_bottom_cycledagger_strike_bottomdeath_criticalrunrun1run2run3run_backwardtalk_neutraltalk_angrytalk_happytalk_neutral_headtalk_angry_headtalk_happy_headbare_readybare_unreadybare_waitbare_strike_left_startbare_strike_left_cyclebare_strike_leftbare_strike_right_startbare_strike_right_cyclebare_strike_rightbare_strike_top_startbare_strike_top_cyclebare_strike_topbare_strike_bottom_startbare_strike_bottom_cyclebare_strike_bottom1h_ready_part_11h_ready_part_21h_unready_part_11h_unready_part_21h_wait1h_strike_left_start1h_strike_left_cycle1h_strike_left1h_strike_right_start1h_strike_right_cycle1h_strike_right1h_strike_top_start1h_strike_top_cycle1h_strike_top1h_strike_bottom_start1h_strike_bottom_cycle1h_strike_bottom2h_ready_part_12h_ready_part_22h_unready_part_12h_unready_part_22h_wait2h_strike_left_start2h_strike_left_cycle2h_strike_left2h_strike_right_start2h_strike_right_cycle2h_strike_right2h_strike_top_start2h_strike_top_cycle2h_strike_top2h_strike_bottom_start2h_strike_bottom_cycle2h_strike_bottommissile_ready_part_1missile_ready_part_2missile_unready_part_1missile_unready_part_2missile_waitmissile_strike_part_1missile_strike_part_2missile_strike_cyclemissile_strikemeditationcast_startcast_cyclecastcast_endcrouchcrouch_walkcrouch_walk_backwardcrouch_strafe_leftcrouch_strafe_rightcrouch_startcrouch_waitcrouch_endlean_rightlean_leftlevitatejumpjump_anticipationjump_upjump_cyclejump_endjump_end_part2fight_walk_forwardfight_walk_backwardfight_walk_ministepfight_strafe_rightfight_strafe_leftfight_waitgruntu_turn_leftu_turn_rightu_turn_left_fightu_turn_right_fight