SetNPCLocation: Difference between revisions

From Onset Developer Wiki
No edit summary
No edit summary
 
Line 1: Line 1:
{{Info|Function|Server|1.0}}
{{Info|Function|Server|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Sets the location of this npc}}


{{FuncSyntax|SetNPCLocation(npc, x, y, z)}}
{{FuncSyntax|SetNPCLocation(npc, x, y, z)}}
Line 11: Line 11:
{{FuncParam|z|Z coordinate}}
{{FuncParam|z|Z coordinate}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|Returns '''true''' on success.}}


== Example ==
== Example ==
Line 21: Line 21:
AddCommand('bringnpc', bringNPC)
AddCommand('bringnpc', bringNPC)
</syntaxhighlight>
</syntaxhighlight>


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

Latest revision as of 14:25, 26 June 2021

SetNPCLocation

Type: Function
Context: Server
Introduced: v1.0

Description

Sets the location of this npc

Syntax

SetNPCLocation(npc, x, y, z)

Parameters

  • npc
    NPC which you want to teleport
  • x
    X coordinate
  • y
    Y coordinate
  • z
    Z coordinate

Return Value

  • Returns true on success.

Example

function bringNPC(player, npc)
   local x,y,z = GetPlayerLocation(player)
   SetNPCLocation(tonumber(npc), x,y,z)
end
AddCommand('bringnpc', bringNPC)

See also