SetNPCAnimation

From Onset Developer Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
SetNPCAnimation

Type: Function
Context: Server
Introduced: v1.0

Description

Plays an animation on an NPC.

Syntax

SetNPCAnimation(npc, animation, loop)

Parameters

  • npc
    The NPC identifier you get from CreateNPC
  • animation
    The animation name as a string or integer, see AnimationList.
  • loop
    true to loop the animation, false to play it a single time.

Return Value

  • Returns true on success.

Example

function cmd_tscene4(player)
	local n1 = CreateNPC(2, 47547.23046875, 138174.515625, 1574.7159423828, -53.268035888672)
	SetNPCAnimation(n1, "CLAP", true)
end
AddCommand("tscene4", cmd_tscene4)

See also