CreateNPC: Difference between revisions

From Onset Developer Wiki
(Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|CreateNPC(modelid, x, y, z, h)}} {{FuncParameters}} {{FuncParam|modelid|__EDIT_ME__}} {{FuncParam|...")
 
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Info|Function|Server|1.0}}
{{Info|Function|Server|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Creates a NPC.}}


{{FuncSyntax|CreateNPC(modelid, x, y, z, h)}}
{{FuncSyntax|CreateNPC(x, y, z, h)}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|modelid|__EDIT_ME__}}
{{FuncParam|x|X location}}
{{FuncParam|x|__EDIT_ME__}}
{{FuncParam|y|Y location}}
{{FuncParam|y|__EDIT_ME__}}
{{FuncParam|z|Z location}}
{{FuncParam|z|__EDIT_ME__}}
{{FuncParam|h|Heading of the npc}}
{{FuncParam|h|__EDIT_ME__}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|The NPC identifier}}


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua">
AddEvent("OnPackageStart", function()
CreateNPC(128959.1015625, 79325.328125, 1579.2750244141, 84.066261291504)
end)
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
{{Template:NPCFunctions}}

Latest revision as of 06:57, 13 December 2019

CreateNPC

Type: Function
Context: Server
Introduced: v1.0

Description

Creates a NPC.

Syntax

CreateNPC(x, y, z, h)

Parameters

  • x
    X location
  • y
    Y location
  • z
    Z location
  • h
    Heading of the npc

Return Value

  • The NPC identifier

Example

AddEvent("OnPackageStart", function()
	CreateNPC(128959.1015625, 79325.328125, 1579.2750244141, 84.066261291504)
end)

See also