Difference between revisions of "LUA:PlayAnimation"

(Syntax: Added 2 params that are on the rewrite)
 
(One intermediate revision by one other user not shown)
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 ==
PlayAnimation([Spawn] spawn, [int32] visual_state, ([Spawn*] state), ([int8] type]))
+
PlayAnimation([Spawn] spawn, [int32] visual_state, ([Spawn*] state), ([int8] type), ([string] emoteText), ([Spawn*] emoteTarget))
  
 
== Example ==
 
== Example ==

Latest revision as of 18:53, 7 May 2020

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.


Back to LUA Spawn Functions Index