You are viewing an old version of this page. Return to the latest version.
Version of 12:46, 23 August 2013 by I need to Update My Profile
Difference between revisions of "LUA:PlayAnimation"
(Created page with "Allows you play an animation through a spawn. == Syntax == PlayAnimation([Spawn] spawn, [int32] visual_state) == Example == <pre> function hailed(NPC, Spawn) PlayAnimation...") |
(→Syntax: Added 2 params that are on the rewrite) |
||
| (3 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
| − | Allows you play an animation through a spawn. | + | 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) | + | 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.