7 LF AOrg
7 LF AOrg
local SilentAimSettings = {
Enabled = false,
TeamCheck = false,
VisibleCheck = false,
TargetPart = "HumanoidRootPart",
SilentAimMethod = "FindPartOnRayWithIgnoreList",
FOVRadius = 130,
FOVVisible = false,
ShowSilentAimTarget = false,
MouseHitPrediction = false,
MouseHitPredictionAmount = 0.165,
HitChance = 100
}
-- variables
getgenv().SilentAimSettings = SilentAimSettings
local MainFileName = "UniversalSilentAim"
local SelectedFile, FileToSave = "", ""
local ExpectedArguments = {
FindPartOnRayWithIgnoreList = {
ArgCountRequired = 3,
Args = {
"Instance", "Ray", "table", "boolean", "boolean"
}
},
FindPartOnRayWithWhitelist = {
ArgCountRequired = 3,
Args = {
"Instance", "Ray", "table", "boolean"
}
},
FindPartOnRay = {
ArgCountRequired = 2,
Args = {
"Instance", "Ray", "Instance", "boolean", "boolean"
}
},
Raycast = {
ArgCountRequired = 3,
Args = {
"Instance", "Vector3", "Vector3", "RaycastParams"
}
}
}
function GetMap()
for i,v in next, workspace:GetChildren() do
if v:FindFirstChild("Spawns") then
return v
end
end
return nil
end
function CalculateChance(Percentage)
-- // Floor the percentage
Percentage = math.floor(Percentage)
-- // Return
return chance <= Percentage / 100
end
--[[file handling]] do
if not isfolder(MainFileName) then
makefolder(MainFileName);
end
-- functions
local function GetFiles() -- credits to the linoria lib for this function,
listfiles returns the files full path and its annoying
local out = {}
for i = 1, #Files do
local file = Files[i]
if file:sub(-4) == '.lua' then
-- i hate this but it has to be done ...
return out
end
Compact = false,
})
Options.HitChance:OnChanged(function()
SilentAimSettings.HitChance = Options.HitChance.Value
end)
end
Toggles.TeamCheck:SetValue(SilentAimSettings.TeamCheck)
Toggles.VisibleCheck:SetValue(SilentAimSettings.VisibleCheck)
Options.TargetPart:SetValue(SilentAimSettings.TargetPart)
Toggles.Visible:SetValue(SilentAimSettings.FOVVisible)
Options.Radius:SetValue(SilentAimSettings.FOVRadius)
Toggles.MousePosition:SetValue(SilentAimSettings.ShowSilentAimTarget)
Toggles.Prediction:SetValue(SilentAimSettings.MouseHitPrediction)
Options.Amount:SetValue(SilentAimSettings.MouseHitPredictionAmount)
Options.HitChance:SetValue(SilentAimSettings.HitChance)
end
end)
end
resume(create(function()
RenderStepped:Connect(function()
if Toggles.MousePosition.Value and Toggles.aim_Enabled.Value then
if getClosestPlayer() then
local Root = getClosestPlayer().Parent.PrimaryPart or
getClosestPlayer()
local RootToViewportPoint, IsOnScreen =
WorldToViewportPoint(Camera, Root.Position);
-- using PrimaryPart instead because if your Target Part is
"Random" it will flicker the square between the Target's Head and HumanoidRootPart
(its annoying)
mouse_box.Visible = IsOnScreen
mouse_box.Position = Vector2.new(RootToViewportPoint.X,
RootToViewportPoint.Y)
else
mouse_box.Visible = false
mouse_box.Position = Vector2.new()
end
end
if Toggles.Visible.Value then
fov_circle.Visible = Toggles.Visible.Value
fov_circle.Color = Options.Color.Value
fov_circle.Position = getMousePosition()
end
end)
end))
RenderStepped:Connect(function(deltaTime)
Map = GetMap()
end)
Toggles.boxesTGL:OnChanged(function()
ESP.Boxes = Toggles.boxesTGL.Value
end)
Toggles.tracersTGL:OnChanged(function()
ESP.Tracers = Toggles.tracersTGL.Value
end)
Toggles.namesTGL:OnChanged(function()
ESP.Names = Toggles.namesTGL.Value
end)
Toggles.teamcolorTgl:OnChanged(function()
ESP.TeamColor = Toggles.teamcolorTgl.Value
end)
Toggles.boxesCameraTgl:OnChanged(function()
ESP.FaceCamera = Toggles.boxesCameraTgl.Value
end)
Options.ESP_Color:OnChanged(function()
ESP.Color = Options.ESP_Color.Value
end)
Toggles.teamESPTgl:OnChanged(function()
ESP.TeamMates = Toggles.teamESPTgl.Value
end)
Library.ToggleKeybind = Options.MenuKeybind
-- hooks
local oldNamecall
oldNamecall = hookmetamethod(game, "__namecall", newcclosure(function(...)
local Method = getnamecallmethod()
local Arguments = {...}
local self = Arguments[1]
local chance = CalculateChance(SilentAimSettings.HitChance)
if Toggles.aim_Enabled.Value and self == workspace and not checkcaller() and
chance == true then
if Method == "FindPartOnRayWithIgnoreList" then
if ValidateArguments(Arguments,
ExpectedArguments.FindPartOnRayWithIgnoreList) then
local A_Ray = Arguments[2]
return oldNamecall(unpack(Arguments))
end
end
end
end
return oldNamecall(...)
end))
-- Library functions
-- Sets the watermark visibility
Library:SetWatermarkVisibility(true)
local WatermarkConnection =
game:GetService('RunService').RenderStepped:Connect(function()
FrameCounter += 1;
Library:OnUnload(function()
WatermarkConnection:Disconnect()
print('Unloaded!')
Library.Unloaded = true
end)
-- Addons:
-- SaveManager (Allows you to have a configuration system)
-- ThemeManager (Allows you to have a menu theme system)
-- Builds our theme menu (with plenty of built in themes) on the left side
-- NOTE: you can also call ThemeManager:ApplyToGroupbox to add it to a specific
groupbox
ThemeManager:ApplyToTab(Tabs['UI Settings'])