The summonPlayer native AI script function can be used by a bot to summon a player to its location or to a specific location. This can be used, for example, by a boss to teleport a player to its location, or to create a teleporter.
()summonPlayer(botIndex: f, playerEid: s) // summonPlayer_fs_
($playerId)getRandomPlayerAggroListTarget(0);
()summonPlayer(0, $playerEid); // Teleport the player to the bot's location.
This example code gets a random player from the current group's aggro list and teleports them to the location of bot 0. The $playerId
variable is used to store the entityId of the player, and $playerEid
is used as the parameter for the summonPlayer
function.