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.
(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
: Returns the Entity ID of the player that is clicking on a bot.