-- LUA Script - precede every function and global member with lowercase name of script + '_main' g_measuring_rods = {} function measuring_rod_init(e) end function measuring_rod_main(e) StopAnimation(e) SetAnimationFrame(e,0) local Ent = g_Entity[e] if g_measuring_rods[e] == nil then g_measuring_rods[e] = {x = Ent.x, z = Ent.z} end for k,_v in pairs(g_measuring_rods) do if k ~= e then local OEnt = g_Entity[k] local DX, DY, DZ = Ent.x - OEnt.x, Ent.y - OEnt.y, Ent.z - OEnt.z -- PromptLocal(e, math.sqrt(DX * DX + DZ * DZ)) PromptLocal(e, DX .. ", " .. DY .. ", " .. DZ) end end end