--==--==--==--==--==--==--==--==--==--==--==
--==
--== dx9 -aim viewer - replace player name with enemy
--==
--==--==--==--==--==--==--==--==--==--==--==
local dm = dx9.GetDatamodel();
local ws = dx9.FindFirstChildOfClass(dm, "Workspace");
local pl = dx9.FindFirstChild(ws, "Players");
local pity = dx9.FindFirstChild(pl, "pitythepoor"); --replace with target name
local pity_h = dx9.FindFirstChild(pity, "HumanoidRootPart");
local bodyeffects = dx9.FindFirstChild(pity, "BodyEffects");
local mp = dx9.FindFirstChild(bodyeffects, "MousePos");
---- get enemy position
local ep_world = dx9.GetPosition(pity_h);
local ep_screen = dx9.WorldToScreen({ep_world.x, ep_world.y, ep_world.z});
---- get position
local mp_world = dx9.Getvec3(mp);
local mp_screen = dx9.WorldToScreen({mp_world.x, mp_world.y, mp_world.z});
---- if no tool equipped, no point drawing last location
if(_G.OldPos == nil) then
_G.OldPos = mp_world.x;
end
if(dx9.FindFirstChildOfClass(pity, "Tool") == 0) then
_G.OldPos = mp_world.x;
end
---- draw
if((_G.OldPos ~= mp_world.x) and (mp_screen.x ~= 0 and mp_screen.y ~= 0)) then
dx9.DrawLine({ep_screen.x, ep_screen.y}, {mp_screen.x, mp_screen.y},
{255,255,255});
end