diff --git a/lua/starfall/libs_cl/render.lua b/lua/starfall/libs_cl/render.lua index 213ef6159..9d9819773 100644 --- a/lua/starfall/libs_cl/render.lua +++ b/lua/starfall/libs_cl/render.lua @@ -2056,8 +2056,8 @@ function render_library.traceSurfaceColor(vec1, vec2) return cwrap(render.GetSurfaceColor(vunwrap(vec1), vunwrap(vec2)):ToColor()) end ---- Checks if a hud component is connected to the Starfall Chip --- @return boolean Whether a hud component is connected to the SF Chip and active +--- Checks if the client is connected to a HUD component that's linked to this chip +-- @return boolean True if a HUD component is connected and active, nil otherwise function render_library.isHUDActive() return SF.IsHUDActive(instance.entity) end diff --git a/lua/starfall/libs_sh/players.lua b/lua/starfall/libs_sh/players.lua index 8db0c6e71..61781f0c3 100644 --- a/lua/starfall/libs_sh/players.lua +++ b/lua/starfall/libs_sh/players.lua @@ -510,6 +510,13 @@ if SERVER then ply:SetModelScale(math.Clamp(math.Truncate(scale, 2), 0.01, playerMaxScale:GetFloat())) end + --- Checks if the player is connected to a HUD component that's linked to this chip + -- @server + -- @return boolean True if a HUD component is connected and active for the player, nil otherwise + function player_methods:isHUDActive() + return SF.IsHUDActive(instance.entity, getply(self)) + end + --- Sets the view entity of the player. Only works if they are linked to a hud. -- @server -- @param Entity ent Entity to set the player's view entity to, or nothing to reset it