Difference between revisions of "TeleportEntity"

From Nomad DB
(Created page with "Set the entity position of one entity to be the same as the position of another entity. == Syntax == <syntaxhighlight lang="lua"> TeleportEntity(targetEntityId, destinationEn...")
 
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
Set the entity position of one entity to be the same as the position of another entity.
+
{{Page_WD2}}
 +
Teleports the target entity to the destination entity.
  
 
== Syntax ==
 
== Syntax ==
Line 5: Line 6:
 
TeleportEntity(targetEntityId, destinationEntityId, useLoadingScreen, useFadeToBlack)
 
TeleportEntity(targetEntityId, destinationEntityId, useLoadingScreen, useFadeToBlack)
 
</syntaxhighlight>
 
</syntaxhighlight>
* '''targetEntityId''' ([[EntityId]]): ID of the entity to teleport
+
* '''targetEntityId''' (string): [[EntityId|ID]] of the entity to be teleported
* '''destinationEntityId''' ([[EntityId]]): ID of the entity to teleport to
+
* '''destinationEntityId''' (string): [[EntityId|ID]] of the entity to teleport to
* '''useLoadingScreen''' (boolean): Whether to show a loading screen if the player teleports into a new map area
+
* '''useLoadingScreen''' (number): Whether to show a loading screen if the player teleports into a new map area (0 = false; 1 = true)
* '''useFadeToBlack''' (boolean): Whether to use a fade to black screen animation before teleporting the player
+
* '''useFadeToBlack''' (number): Whether to use a fade to black animation before teleporting the player (0 = false; 1 = true)
  
 
== Example ==
 
== Example ==
Line 16: Line 17:
  
 
== Related Pages ==
 
== Related Pages ==
 +
* [[Entity]]
 
* [[EntityId]]
 
* [[EntityId]]
  
 
[[Category:WD2 Lua]] [[Category: WD2 Entity]]
 
[[Category:WD2 Lua]] [[Category: WD2 Entity]]

Latest revision as of 20:44, 27 October 2020

Teleports the target entity to the destination entity.

Syntax

TeleportEntity(targetEntityId, destinationEntityId, useLoadingScreen, useFadeToBlack)
  • targetEntityId (string): ID of the entity to be teleported
  • destinationEntityId (string): ID of the entity to teleport to
  • useLoadingScreen (number): Whether to show a loading screen if the player teleports into a new map area (0 = false; 1 = true)
  • useFadeToBlack (number): Whether to use a fade to black animation before teleporting the player (0 = false; 1 = true)

Example

TeleportEntity(GetLocalPlayerEntityId(), "2083162933598368435", 0, 0)

Related Pages