Difference between revisions of "LUA:PlayAnimation"

Line 1: Line 1:
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.
+
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 ==
 
== Syntax ==

Revision as of 11:14, 7 September 2013

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]))

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.


Back to LUA Spawn Functions Index