SetNPCFollowPlayer: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|SetNPCFollowPlayer(npc, player [, speed])}} {{FuncParameters}} {{FuncParam|npc|__EDIT_ME__}} {{Fun..." |
FlyingFork (talk | contribs) No edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Info|Function|Server|1.0}} | {{Info|Function|Server|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Set a NPC to follow the specified player.}} | ||
{{FuncSyntax|SetNPCFollowPlayer(npc, player [, speed])}} | {{FuncSyntax|SetNPCFollowPlayer(npc, player [, speed])}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|npc| | {{FuncParam|npc|The NPC identifier.}} | ||
{{FuncParam|player | | {{FuncParam|player |The player identifier.}} | ||
{{FuncParamOptional|speed| | {{FuncParamOptional|speed|The speed.}} | ||
{{FuncReturnValue| | {{FuncReturnValue|This function returns nothing.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
AddCommand("follow", function(player) | |||
SetNPCFollowPlayer(npc, player) | |||
end) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{Template:NPCFunctions}} |
Latest revision as of 14:26, 26 June 2021
Description
Set a NPC to follow the specified player.
Syntax
SetNPCFollowPlayer(npc, player [, speed])
Parameters
- npc
The NPC identifier. - player
The player identifier. - speed (optional)
The speed.
Return Value
- This function returns nothing.
Example
AddCommand("follow", function(player)
SetNPCFollowPlayer(npc, player)
end)
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