0% found this document useful (0 votes)
33 views9 pages

Universal Silent Aim Configuration Guide

yaywa

Uploaded by

lrmo3400
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)
33 views9 pages

Universal Silent Aim Configuration Guide

yaywa

Uploaded by

lrmo3400
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

-- init

if not game:IsLoaded() then


[Link]:Wait()
end

if not syn or not protectgui then


getgenv().protectgui = function() end
end

local SilentAimSettings = {
Enabled = false,

ClassName = "Universal Silent Aim - Aethiel",


ToggleKey = "RightAlt",

TeamCheck = false,
VisibleCheck = false,
TargetPart = "HumanoidRootPart",
SilentAimMethod = "Raycast",

FOVRadius = 130,
FOVVisible = false,
ShowSilentAimTarget = false,

MouseHitPrediction = false,
MouseHitPredictionAmount = 0.165,
HitChance = 100
}

-- variables
getgenv().SilentAimSettings = Settings
local MainFileName = "UniversalSilentAim"
local SelectedFile, FileToSave = "", ""

local Camera = [Link]


local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local GuiService = game:GetService("GuiService")
local UserInputService = game:GetService("UserInputService")
local HttpService = game:GetService("HttpService")

local LocalPlayer = [Link]


local Mouse = LocalPlayer:GetMouse()

local GetChildren = [Link]


local GetPlayers = [Link]
local WorldToScreen = [Link]
local WorldToViewportPoint = [Link]
local GetPartsObscuringTarget = [Link]
local FindFirstChild = [Link]
local RenderStepped = [Link]
local GuiInset = [Link]
local GetMouseLocation = [Link]

local resume = [Link]


local create = [Link]

local ValidTargetParts = {"Head", "HumanoidRootPart"}


local PredictionAmount = 0.165
local mouse_box = [Link]("Square")
mouse_box.Visible = true
mouse_box.ZIndex = 999
mouse_box.Color = [Link](54, 57, 241)
mouse_box.Thickness = 20
mouse_box.Size = [Link](20, 20)
mouse_box.Filled = true

local fov_circle = [Link]("Circle")


fov_circle.Thickness = 1
fov_circle.NumSides = 100
fov_circle.Radius = 180
fov_circle.Filled = false
fov_circle.Visible = false
fov_circle.ZIndex = 999
fov_circle.Transparency = 1
fov_circle.Color = [Link](54, 57, 241)

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 CalculateChance(Percentage)
-- // Floor the percentage
Percentage = [Link](Percentage)

-- // Get the chance


local chance = [Link]([Link]().NextNumber([Link](), 0, 1) * 100) /
100

-- // Return
return chance <= Percentage / 100
end
--[[file handling]] do
if not isfolder(MainFileName) then
makefolder(MainFileName);
end

if not isfolder([Link]("%s/%s", MainFileName, tostring([Link])))


then
makefolder([Link]("%s/%s", MainFileName, tostring([Link])))
end
end

local Files = listfiles([Link]("%s/%s", "UniversalSilentAim",


tostring([Link])))

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

local pos = file:find('.lua', 1, true)


local start = pos

local char = file:sub(pos, pos)


while char ~= '/' and char ~= '\\' and char ~= '' do
pos = pos - 1
char = file:sub(pos, pos)
end

if char == '/' or char == '\\' then


[Link](out, file:sub(pos + 1, start - 1))
end
end
end

return out
end

local function UpdateFile(FileName)


assert(FileName or FileName == "string", "oopsies");
writefile([Link]("%s/%s/%[Link]", MainFileName, tostring([Link]),
FileName), HttpService:JSONEncode(SilentAimSettings))
end

local function LoadFile(FileName)


assert(FileName or FileName == "string", "oopsies");

local File = [Link]("%s/%s/%[Link]", MainFileName,


tostring([Link]), FileName)
local ConfigData = HttpService:JSONDecode(readfile(File))
for Index, Value in next, ConfigData do
SilentAimSettings[Index] = Value
end
end

local function getPositionOnScreen(Vector)


local Vec3, OnScreen = WorldToScreen(Camera, Vector)
return [Link](Vec3.X, Vec3.Y), OnScreen
end

local function ValidateArguments(Args, RayMethod)


local Matches = 0
if #Args < [Link] then
return false
end
for Pos, Argument in next, Args do
if typeof(Argument) == [Link][Pos] then
Matches = Matches + 1
end
end
return Matches >= [Link]
end

local function getDirection(Origin, Position)


return (Position - Origin).Unit * 1000
end

local function getMousePosition()


return GetMouseLocation(UserInputService)
end

local function IsPlayerVisible(Player)


local PlayerCharacter = [Link]
local LocalPlayerCharacter = [Link]

if not (PlayerCharacter or LocalPlayerCharacter) then return end

local PlayerRoot = FindFirstChild(PlayerCharacter, [Link]) or


FindFirstChild(PlayerCharacter, "HumanoidRootPart")

if not PlayerRoot then return end

local CastPoints, IgnoreList = {[Link], LocalPlayerCharacter,


PlayerCharacter}, {LocalPlayerCharacter, PlayerCharacter}
local ObscuringObjects = #GetPartsObscuringTarget(Camera, CastPoints,
IgnoreList)

return ((ObscuringObjects == 0 and true) or (ObscuringObjects > 0 and false))


end

local function getClosestPlayer()


if not [Link] then return end
local Closest
local DistanceToMouse
for _, Player in next, GetPlayers(Players) do
if Player == LocalPlayer then continue end
if [Link] and [Link] == [Link] then
continue end

local Character = [Link]


if not Character then continue end

if [Link] and not IsPlayerVisible(Player) then continue


end
local HumanoidRootPart = FindFirstChild(Character, "HumanoidRootPart")
local Humanoid = FindFirstChild(Character, "Humanoid")
if not HumanoidRootPart or not Humanoid or Humanoid and [Link] <=
0 then continue end

local ScreenPosition, OnScreen =


getPositionOnScreen([Link])
if not OnScreen then continue end

local Distance = (getMousePosition() - ScreenPosition).Magnitude


if Distance <= (DistanceToMouse or [Link] or 2000) then
Closest = (([Link] == "Random" and
Character[ValidTargetParts[[Link](1, #ValidTargetParts)]]) or
Character[[Link]])
DistanceToMouse = Distance
end
end
return Closest
end

-- ui creating & handling


local Library = loadstring(game:HttpGet("[Link]
suzutsuki/LinoriaLib/main/[Link]"))()

local Window = Library:CreateWindow("Universal Silent Aim, by Averiias, xaxa, and


Stefanuk12")
local GeneralTab = Window:AddTab("General")
local MainBOX = GeneralTab:AddLeftTabbox("Main") do
local Main = MainBOX:AddTab("Main")

Main:AddToggle("aim_Enabled", {Text =
"Enabled"}):AddKeyPicker("aim_Enabled_KeyPicker", {Default = "RightAlt",
SyncToggleState = true, Mode = "Toggle", Text = "Enabled", NoUI = false});
Options.aim_Enabled_KeyPicker:OnClick(function()
[Link] = not [Link]

Toggles.aim_Enabled.Value = [Link]
Toggles.aim_Enabled:SetValue([Link])

mouse_box.Visible = [Link]
end)

Main:AddToggle("TeamCheck", {Text = "Team Check", Default =


[Link]}):OnChanged(function()
[Link] = [Link]
end)
Main:AddToggle("VisibleCheck", {Text = "Visible Check", Default =
[Link]}):OnChanged(function()
[Link] = [Link]
end)
Main:AddDropdown("TargetPart", {AllowNull = true, Text = "Target Part", Default
= [Link], Values = {"Head", "HumanoidRootPart",
"Random"}}):OnChanged(function()
[Link] = [Link]
end)
Main:AddDropdown("Method", {AllowNull = true, Text = "Silent Aim Method",
Default = [Link], Values = {
"Raycast","FindPartOnRay",
"FindPartOnRayWithWhitelist",
"FindPartOnRayWithIgnoreList",
"[Link]/Target"
}}):OnChanged(function()
[Link] = [Link]
end)
Main:AddSlider('HitChance', {
Text = 'Hit chance',
Default = 100,
Min = 0,
Max = 100,
Rounding = 1,

Compact = false,
})
[Link]:OnChanged(function()
[Link] = [Link]
end)
end

local MiscellaneousBOX = GeneralTab:AddLeftTabbox("Miscellaneous")


local FieldOfViewBOX = GeneralTab:AddLeftTabbox("Field Of View") do
local Main = FieldOfViewBOX:AddTab("Visuals")

Main:AddToggle("Visible", {Text = "Show FOV Circle"}):AddColorPicker("Color",


{Default = [Link](54, 57, 241)}):OnChanged(function()
fov_circle.Visible = [Link]
[Link] = [Link]
end)
Main:AddSlider("Radius", {Text = "FOV Circle Radius", Min = 0, Max = 360,
Default = 130, Rounding = 0}):OnChanged(function()
fov_circle.Radius = [Link]
[Link] = [Link]
end)
Main:AddToggle("MousePosition", {Text = "Show Silent Aim
Target"}):AddColorPicker("MouseVisualizeColor", {Default = [Link](54, 57,
241)}):OnChanged(function()
mouse_box.Visible = [Link]
[Link] = [Link]
end)
local PredictionTab = MiscellaneousBOX:AddTab("Prediction")
PredictionTab:AddToggle("Prediction", {Text = "[Link]/Target
Prediction"}):OnChanged(function()
[Link] = [Link]
end)
PredictionTab:AddSlider("Amount", {Text = "Prediction Amount", Min = 0.165, Max
= 1, Default = 0.165, Rounding = 3}):OnChanged(function()
PredictionAmount = [Link]
[Link] = [Link]
end)
end

local CreateConfigurationBOX = GeneralTab:AddRightTabbox("Create Configuration") do

local Main = CreateConfigurationBOX:AddTab("Create Configuration")

Main:AddInput("CreateConfigTextBox", {Default = "", Numeric = false, Finished =


false, Text = "Create Configuration to Create", Tooltip = "Creates a configuration
file containing settings you can save and load", Placeholder = "File Name
here"}):OnChanged(function()
if [Link] and
[Link]([Link]) ~= "" then
FileToSave = [Link]
end
end)

Main:AddButton("Create Configuration File", function()


if FileToSave ~= "" or FileToSave ~= nil then
UpdateFile(FileToSave)
end
end)
end

local SaveConfigurationBOX = GeneralTab:AddRightTabbox("Save Configuration") do


local Main = SaveConfigurationBOX:AddTab("Save Configuration")
Main:AddDropdown("SaveConfigurationDropdown", {AllowNull = true, Values =
GetFiles(), Text = "Choose Configuration to Save"})
Main:AddButton("Save Configuration", function()
if [Link] then
UpdateFile([Link])
end
end)
end

local LoadConfigurationBOX = GeneralTab:AddRightTabbox("Load Configuration") do


local Main = LoadConfigurationBOX:AddTab("Load Configuration")

Main:AddDropdown("LoadConfigurationDropdown", {AllowNull = true, Values =


GetFiles(), Text = "Choose Configuration to Load"})
Main:AddButton("Load Configuration", function()
if [Link](GetFiles(), [Link]) then
LoadFile([Link])

[Link]:SetValue([Link])
[Link]:SetValue([Link])
[Link]:SetValue([Link])
[Link]:SetValue([Link])
[Link]:SetValue([Link])
[Link]:SetValue([Link])
[Link]:SetValue([Link])
[Link]:SetValue([Link])
[Link]:SetValue([Link])
[Link]:SetValue([Link])
end
end)
end

resume(create(function()
RenderStepped:Connect(function()
if [Link] and Toggles.aim_Enabled.Value then
if getClosestPlayer() then
local Root = getClosestPlayer().[Link] or
getClosestPlayer()
local RootToViewportPoint, IsOnScreen =
WorldToViewportPoint(Camera, [Link]);
-- 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 = [Link](RootToViewportPoint.X,
RootToViewportPoint.Y)
else
mouse_box.Visible = false
mouse_box.Position = [Link]()
end
end

if [Link] then
fov_circle.Visible = [Link]
fov_circle.Color = [Link]
fov_circle.Position = getMousePosition()
end
end)
end))

-- hooks
local oldNamecall
oldNamecall = hookmetamethod(game, "__namecall", newcclosure(function(...)
local Method = getnamecallmethod()
local Arguments = {...}
local self = Arguments[1]
local chance = CalculateChance([Link])
if Toggles.aim_Enabled.Value and self == workspace and not checkcaller() and
chance == true then
if Method == "FindPartOnRayWithIgnoreList" and [Link] ==
Method then
if ValidateArguments(Arguments,
[Link]) then
local A_Ray = Arguments[2]

local HitPart = getClosestPlayer()


if HitPart then
local Origin = A_Ray.Origin
local Direction = getDirection(Origin, [Link])
Arguments[2] = [Link](Origin, Direction)

return oldNamecall(unpack(Arguments))
end
end
elseif Method == "FindPartOnRayWithWhitelist" and [Link] ==
Method then
if ValidateArguments(Arguments,
[Link]) then
local A_Ray = Arguments[2]

local HitPart = getClosestPlayer()


if HitPart then
local Origin = A_Ray.Origin
local Direction = getDirection(Origin, [Link])
Arguments[2] = [Link](Origin, Direction)

return oldNamecall(unpack(Arguments))
end
end
elseif (Method == "FindPartOnRay" or Method == "findPartOnRay") and
[Link]:lower() == Method:lower() then
if ValidateArguments(Arguments, [Link]) then
local A_Ray = Arguments[2]

local HitPart = getClosestPlayer()


if HitPart then
local Origin = A_Ray.Origin
local Direction = getDirection(Origin, [Link])
Arguments[2] = [Link](Origin, Direction)

return oldNamecall(unpack(Arguments))
end
end
elseif Method == "Raycast" and [Link] == Method then
if ValidateArguments(Arguments, [Link]) then
local A_Origin = Arguments[2]

local HitPart = getClosestPlayer()


if HitPart then
Arguments[3] = getDirection(A_Origin, [Link])

return oldNamecall(unpack(Arguments))
end
end
end
end
return oldNamecall(...)
end))

local oldIndex = nil


oldIndex = hookmetamethod(game, "__index", newcclosure(function(self, Index)
if self == Mouse and not checkcaller() and Toggles.aim_Enabled.Value and
[Link] == "[Link]/Target" and getClosestPlayer() then
local HitPart = getClosestPlayer()

if Index == "Target" or Index == "target" then


return HitPart
elseif Index == "Hit" or Index == "hit" then
return (([Link] and ([Link] +
([Link] * PredictionAmount))) or (not [Link] and
[Link]))
elseif Index == "X" or Index == "x" then
return self.X
elseif Index == "Y" or Index == "y" then
return self.Y
elseif Index == "UnitRay" then
return [Link]([Link], ([Link] - [Link]).Unit)
end
end

return oldIndex(self, Index)


end))

You might also like