There was an error while loading. Please reload this page.
The getCurrentSpeakerEid native AI script function gets the EntityId of the bot at which the player is clicking at.
This function is only valid when called from a player_target_npc event. {.is-warning}
player_target_npc
(botEidAsString: s)getCurrentSpeakerEid()
($botEid)getCurrentSpeakerEid(); ($playerEid)getCurrentPlayerEid(); phrasePushString("player", $playerEid); phrasePushString("bot", $botEid); (index)getBotIndex($botEid); phraseEndEmotMsg(index, "EMOT_PLAYER_INSULT_BOT");
This example code gets the EntityId of the bot clicked by the player and uses it in a chat message.
getCurrentPlayerEid