Skip to content

← Previous | Next →


teleport

Description

Teleports the NPC to the specified entity if the entity is not within a certain distance.

Basic information

Name Type Possibilities
teleport behaviour 2

Parameters

# Name Type Mandatory Description Multiple
1 entity Entity Yes The entity to which the NPC will teleport. No
2 distance number No The maximum distance at which teleportation won't occur. If the NPC is within this distance from the entity, no teleportation happens. Defaults to nil if not specified. No

Outputs

# Description
1 The NPC is already within the specified distance from the entity.
2 The NPC teleports to the specified entity.

Example


  NPC 

  name Teleporter 
  model s_m_m_security_01 
  position -1020.72 4839.78 258.30 0.0 

  interaction 
    nothing 

  behaviour 
    getClosestPlayer closestPlayer 15 
      teleport $closestPlayer 10