No categories assigned
LUA:PlayAnimation
- Last edited 5 years ago by I need to Update My Profile
Allows you play an animation through a spawn. The third and fourth parameters are optional. The third parameter must be a player if used. The third parameter is to be a player that you either wish to be the only client to send an animation to, or to exclude that client. Using 1 for the type param send the animation to param 3, using 2 sends the animation to all others in range. The type param defaults to 1 if not set.
Syntax
PlayAnimation([Spawn] spawn, [int32] visual_state, ([Spawn*] state), ([int8] type), ([string] emoteText), ([Spawn*] emoteTarget))
Example
function hailed(NPC, Spawn)
PlayAnimation(NPC, 121)
end
When an NPC with this function is hailed, that NPC will use the visual state with the ID of 121 which is the bow animation.