0% found this document useful (0 votes)
34 views

Message

This document contains code for a Roblox script that implements silent aimbot functionality. It finds the nearest enemy player, calculates the distance to their head and hitbox, and sets the aim target to either the head or hitbox depending on configuration and which is closer.

Uploaded by

camila
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Message

This document contains code for a Roblox script that implements silent aimbot functionality. It finds the nearest enemy player, calculates the distance to their head and hitbox, and sets the aim target to either the head or hitbox depending on configuration and which is closer.

Uploaded by

camila
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

local Players = game:GetService("Players")

local LocalPlayer = Players.LocalPlayer


local mouse = LocalPlayer:GetMouse()
local Camera = workspace.CurrentCamera
local Debris = game:GetService("Debris")
local UserInputService = game:GetService("UserInputService")
local target = false
local RunService = game:GetService("RunService")

getfenv().lock = "Random" -- Head or Hitbox or Random

fov = 250;
local fovCircle = true;
local st = tonumber(tick());
warn("Loading script...")

if fovCircle then
function createcircle()
local
a=Drawing.new('Circle');a.Transparency=1;a.Thickness=1.5;a.Visible=true;a.Color=Col
or3.fromRGB(0,255,149);a.Filled=false;a.Radius=fov;
return a;
end;
local fovc = createcircle();
spawn(function()
RunService:BindToRenderStep("FovCircle",1,function()
fovc.Position = Vector2.new(mouse.X,mouse.Y)
end);
end);
end;

function isFfa()
local am = #Players:GetChildren();
local amm = 0;
for i , v in pairs(Players:GetChildren()) do
if v.Team == LocalPlayer.Team then
amm = amm + 1;
end;
end;
return am == amm;
end;
function getnearest()
local nearestmagnitude = math.huge
local nearestenemy = nil
local vector = nil
local ffa = isFfa();
for i,v in next, Players:GetChildren() do
if ffa == false and v.Team ~= LocalPlayer.Team or ffa == true then
if v.Character and
v.Character:FindFirstChild("HumanoidRootPart") and
v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health > 0 then
local vector, onScreen =
Camera:WorldToScreenPoint(v.Character["HumanoidRootPart"].Position)
if onScreen then
local ray = Ray.new(
Camera.CFrame.p,
(v.Character["Head"].Position-
Camera.CFrame.p).unit*500
)
local ignore = {
LocalPlayer.Character,
}
local
hit,position,normal=workspace:FindPartOnRayWithIgnoreList(ray,ignore)
if hit and hit:FindFirstAncestorOfClass("Model") and
Players:FindFirstChild(hit:FindFirstAncestorOfClass("Model").Name)then
local magnitude = (Vector2.new(mouse.X,
mouse.Y) - Vector2.new(vector.X, vector.Y)).magnitude
if magnitude < nearestmagnitude and magnitude
<= fov then
nearestenemy = v
nearestmagnitude = magnitude
end
end
end
end
end
end
return nearestenemy
end

local meta = getrawmetatable(game)


setreadonly(meta, false)
local oldNamecall = meta.__namecall
meta.__namecall = newcclosure(function(...)

local method = getnamecallmethod()


local args = {...}
if string.find(method,'Ray') then
if target then
if args[1].Name ~= "Workspace" then
print(args[1])
end;
args[2] = Ray.new(workspace.CurrentCamera.CFrame.Position,
(target.Position + Vector3.new(0,(workspace.CurrentCamera.CFrame.Position-
target.Position).Magnitude/500,0) - workspace.CurrentCamera.CFrame.Position).unit *
5000)
end
end
return oldNamecall(unpack(args))
end)

warn("Script loaded!\nTime taken: "..math.abs(tonumber(tick())-st))


RunService:BindToRenderStep("SilentAim",1,function()
if UserInputService:IsMouseButtonPressed(0) and Players.LocalPlayer.Character
and Players.LocalPlayer.Character:FindFirstChild("Humanoid") and
Players.LocalPlayer.Character.Humanoid.Health > 0 then
local enemy = getnearest()
if enemy and enemy.Character and
enemy.Character:FindFirstChild("Humanoid") and enemy.Character.Humanoid.Health > 0
then
local vector, onScreen =
Camera:WorldToScreenPoint(enemy.Character["Head"].Position)
local head = (Vector2.new(mouse.X, mouse.Y) -
Vector2.new(vector.X, vector.Y)).magnitude
local vector, onScreen =
Camera:WorldToScreenPoint(enemy.Character["HumanoidRootPart"].Position)
local hitbox = (Vector2.new(mouse.X, mouse.Y) -
Vector2.new(vector.X, vector.Y)).magnitude
if head <= hitbox then
magnitude = head
else
magnitude = hitbox;
end;
if getfenv().lock == "Head" then
target = workspace[enemy.Name]["Head"]
else
if getfenv().lock == "Random" then
if magnitude == hitbox then
target = workspace[enemy.Name]
["HumanoidRootPart"];
else
target = workspace[enemy.Name]["Head"]
end;
else
target = workspace[enemy.Name]["HumanoidRootPart"];
end;

end;
else
target = nil
end
end
end)

You might also like