SetNPCTargetLocation

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.
SetNPCTargetLocation

Type: Function
Context: Server
Introduced: v1.0

Description

Set the NPC's target location where it should go towards to.

Syntax

SetNPCTargetLocation(npc, x, y, z [, speed])

Parameters

  • npc
    The Npc identifier
  • x
    The X axis
  • y
    The Y axis
  • z
    The Z axis
  • speed (optional)
    The movement speed in cm.

Return Value

  • Returns true on success.

Example

-- Makes the NPC go towards the player's location.
local x, y, z = GetPlayerLocation(playerId)
SetNPCTargetLocation(NpcId, x, y, z, 200.0)

See also