SetNPCTargetLocation

From Onset Developer Wiki
Revision as of 07:55, 29 December 2019 by 28days (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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