0% found this document useful (0 votes)
3K views1 page

DX9 Aim Viewer Script for Da Hood

This document contains code to replace a player's name with an enemy target name in an aim viewer script for a Roblox game. It finds the enemy player object, gets the enemy's position, gets the mouse position, and draws a line between them on screen if the positions have changed, to show where the enemy is being aimed at.

Uploaded by

eduardo suarez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3K views1 page

DX9 Aim Viewer Script for Da Hood

This document contains code to replace a player's name with an enemy target name in an aim viewer script for a Roblox game. It finds the enemy player object, gets the enemy's position, gets the mouse position, and draws a line between them on screen if the positions have changed, to show where the enemy is being aimed at.

Uploaded by

eduardo suarez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

--==--==--==--==--==--==--==--==--==--==--==

--==
--== 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

You might also like