The QBCore.Functions.LookAtEntity function in Lua makes a player's character turn to face a specified entity in the game. It checks if the entity exists and if the input parameters are valid. It then calculates the direction to the entity and gradually adjusts the player's heading to match this direction. The function stops either when the player is facing the entity or when the specified timeout is reached.
The QBCore.Functions.LookAtEntity function in Lua makes a player's character turn to face a specified entity in the game. It checks if the entity exists and if the input parameters are valid. It then calculates the direction to the entity and gradually adjusts the player's heading to match this direction. The function stops either when the player is facing the entity or when the specified timeout is reached.