Long sought how to calculate PPI (Pixels Per Inch) to more accurately place elements on the screen individually for each player, and that's it. Post here, maybe someone will need.
Code:
local a = 1366; // Width of the screen
local b = 768; // Height of the screen
local pix = 37.79527559055; //Pixels per cm
local inc = 0.39; // Inchs per cm
local dia = sqrt(a*a + b*b); // Calculate diagonal of the screen in pixels
local dia_to_cm = (dia/pix); // Calculate diagonal of the screen in cm
local cm_to_inc = (dia_to_cm.tointeger() * inc); // Calculate diagonal of the screen in inchs
local ppi = dia/cm_to_inc; // Calculate PPI
print(ppi.tointeger()); // Print PPI
Checked the accuracy on a special website