From aa27d9fd365659b3139b922d12c365ae6569305b Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Tue, 18 Feb 2025 21:34:57 -0500 Subject: [PATCH] feat(lib): add distance function --- lib/utils.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/utils.lua b/lib/utils.lua index cf6023b..03a48bc 100644 --- a/lib/utils.lua +++ b/lib/utils.lua @@ -12,6 +12,10 @@ function get_player(name) end)[1] end +function distance(p1, p2) + return math.sqrt((p2.x - p1.x) ^ 2 + (p2.y - p1.y) ^ 2 + (p2.z - p1.z) ^ 2) +end + function dump(object) if type(object) == "table" then local string = "{ "