SetNPCAnimation: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
{{FuncSyntax|SetNPCAnimation(npc, animation, loop)}} | {{FuncSyntax|SetNPCAnimation(npc, animation, loop)}} | ||
<div class="noprint" style="float:right;"> | |||
[[File:VIDEO_SetNPCAnimation.gif]] | |||
</div> | |||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|npc|The NPC identifier you get from [[CreateNPC]]}} | {{FuncParam|npc|The NPC identifier you get from [[CreateNPC]]}} | ||
{{FuncParam|animation|The animation name as a string.}} | {{FuncParam|animation|The animation name as a string or integer, see [[AnimationList]].}} | ||
{{FuncParam|loop|'''true''' to loop the animation, '''false''' to play it a single time.}} | {{FuncParam|loop|'''true''' to loop the animation, '''false''' to play it a single time.}} | ||
Line 22: | Line 24: | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{Template:NPCFunctions}} |
Latest revision as of 10:07, 23 February 2021
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
- GetStreamedNPC
- GetNPCLocation
- SetNPCOutline
- SetNPCPropertyValue
- GetNPCPropertyValue
- CreateNPC
- DestroyNPC
- IsValidNPC
- GetAllNPC
- GetNPCCount
- IsNPCStreamedIn
- SetNPCLocation
- GetNPCLocation
- SetNPCHealth
- GetNPCHealth
- SetNPCAnimation
- SetNPCHeading
- GetNPCHeading
- SetNPCTargetLocation
- SetNPCFollowPlayer
- SetNPCFollowVehicle
- SetNPCRagdoll
- SetNPCRespawnTime