hello @MTA.Castiel
Get ground coordinates with getGroundPosition
GetDistancePointBetween3D to find distance.
addCommandHandler("distanceground",
function()
local px, py, pz = getElementPosition(localPlayer)
local groundPosition = getGroundPosition(px, py, pz)
local distanceGround = getDistanceBetweenPoints3D(px, py, pz, px, py, groundPosition)
outputDebugString("distance ground:"..distanceGround)
end
)
you can do a test run