From c310593929b3603da3033a81de90b2108d879f91 Mon Sep 17 00:00:00 2001 From: Cuh4 <89425262+Cuh4@users.noreply.github.com> Date: Thu, 6 Jun 2024 00:24:43 +0100 Subject: [PATCH] add :GetLook() player class method --- src/Noir/Classes/Player.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Noir/Classes/Player.lua b/src/Noir/Classes/Player.lua index de41b88..6fb2c04 100644 --- a/src/Noir/Classes/Player.lua +++ b/src/Noir/Classes/Player.lua @@ -286,6 +286,22 @@ function Noir.Classes.PlayerClass:IsDowned() return data.dead or data.incapacitated or data.hp <= 0 end +--[[ + Returns this player's look direction. +]] +---@return number LookX +---@return number LookY +---@return number LookZ +function Noir.Classes.PlayerClass:GetLook() + local x, y, z, success = server.getPlayerLookDirection(self.ID) + + if not success then + return 0, 0, 0 + end + + return x, y, z +end + ------------------------------- -- // Intellisense -------------------------------