Universal Silent Aim July 2022 Updated
Universal Silent Aim July 2022 Updated
Universal Silent Aim July 2022 Updated
Information:
- Inspired by
https://github.com/Averiias/Universal-SilentAim/blob/main/main.lua
You can combine methods. Simply seperate them with a comma. For example:
"Target,UnitRay"
-> Make sure you use the supported methods exactly (Capitalisation matters!)
]]
-- // Dependencies
local _, AimingPage, _ =
loadstring(game:HttpGet("https://raw.githubusercontent.com/Stefanuk12/Aiming/main/
GUI.lua"))()
local Aiming =
loadstring(game:HttpGet("https://raw.githubusercontent.com/Stefanuk12/Aiming/main/
Load.lua"))()("Module")
local AimingChecks = Aiming.Checks
local AimingSelected = Aiming.Selected
local AimingSettingsIgnored = Aiming.Settings.Ignored
local AimingSettingsIgnoredPlayers = Aiming.Settings.Ignored.Players
local AimingSettingsIgnoredWhitelistMode = AimingSettingsIgnored.WhitelistMode
-- // Services
local UserInputService = game:GetService("UserInputService")
-- // Config
local Configuration = {
-- // The ones under this you may change - if you are a normal user
Enabled = true,
Method = "Target,Hit",
FocusMode = false, -- // Stays locked on to that player only. If true then uses
the silent aim keybind, if a input type is entered, then that is used
ToggleBind = false, -- // true = Toggle, false = Hold (to enable)
Keybind = Enum.UserInputType.MouseButton2, -- // You can also have
Enum.KeyCode.E, etc.
-- // Do not change anything below here - if you are not a normal user
CurrentlyFocused = nil,
SupportedMethods = {
__namecall = {"Raycast", "FindPartOnRay", "FindPartOnRayWithWhitelist",
"FindPartOnRayWithIgnoreList"},
__index = {"Target", "Hit", "X", "Y", "UnitRay"}
},
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"
}
}
}
}
local IsToggled = false
Aiming.SilentAim = Configuration
-- // Functions
local function CalculateDirection(Origin, Destination, Length)
return (Destination - Origin).Unit * Length
end
-- // Vars
local LoweredMethod = stringlower(Method)
local FoundI = tablefind(PossibleMethods, Method) or tablefind(PossibleMethods,
LoweredMethod) -- // to cover stuff like target (lowercase)
local Found = FoundI ~= nil
local Matches = LoweredMethod == stringlower(Given)
-- // Return
return Found and Matches
end
-- //
if (State) then
if (not FoundI) then
table.insert(EnabledMethods, Method)
end
else
if (FoundI) then
table.remove(EnabledMethods, FoundI)
end
end
-- // Set
Configuration.Method = table.concat(EnabledMethods, ",")
end
-- // Focuses a player
local Backup = {table.unpack(AimingSettingsIgnoredPlayers)}
function Configuration.FocusPlayer(Player)
table.insert(AimingSettingsIgnoredPlayers, Player)
AimingSettingsIgnoredWhitelistMode.Players = true
end
-- // Unfocuses a player
function Configuration.Unfocus(Player)
-- // Find it within ignored, and remove if found
local PlayerI = table.find(AimingSettingsIgnoredPlayers, Player)
if (PlayerI) then
table.remove(AimingSettingsIgnoredPlayers, PlayerI)
end
-- //
function Configuration.FocusHandler()
if (Configuration.CurrentlyFocused) then
Configuration.Unfocus(Configuration.CurrentlyFocused)
Configuration.CurrentlyFocused = nil
return
end
if (AimingChecks.IsAvailable()) then
Configuration.FocusPlayer(AimingSelected.Instance)
Configuration.CurrentlyFocused = AimingSelected.Instance
end
end
UserInputService.InputBegan:Connect(function(Input, GameProcessedEvent)
-- // Make sure is not processed
if (GameProcessedEvent) then
return
end
-- // FocusMode check
if (typeof(FocusMode) == "Enum" and CheckInput(Input, FocusMode)) then
Configuration.FocusHandler()
end
end)
UserInputService.InputEnded:Connect(function(Input, GameProcessedEvent)
-- // Make sure is not processed
if (GameProcessedEvent) then
return
end
-- // Check if matches bind
if (CheckInput(Input, Configuration.Keybind) and not Configuration.ToggleBind)
then
IsToggled = false
end
end)
-- // Hooks
local __namecall
__namecall = hookmetamethod(game, "__namecall", function(...)
-- // Vars
local args = {...}
local self = args[1]
local method = getnamecallmethod()
local callingscript = getcallingscript()
-- // Return
return __namecall(unpack(args))
end
-- // Return
return __namecall(unpack(args))
end
-- //
return __namecall(...)
end)
local __index
__index = hookmetamethod(game, "__index", function(t, k)
-- // Vars
local callingscript = getcallingscript()
-- // Hit
if (LoweredK == "hit") then
return Configuration.ModifyCFrame(false)
end
-- // X/Y
if (LoweredK == "x" or LoweredK == "y") then
return Configuration.ModifyCFrame(true)[k]
end
-- // UnitRay
if (LoweredK == "unitray") then
local Origin = __index(t, k).Origin
local Direction = CalculateDirection(Origin,
Configuration.ModifyCFrame(false).Position)
return Ray.new(Origin, Direction)
end
end
-- // Return
return __index(t, k)
end)
-- // GUI
local SilentAimSection = AimingPage:addSection({
title = "Silent Aim"
})
SilentAimSection:addToggle({
title = "Enabled",
default = Configuration.Enabled,
callback = function(value)
Configuration.Enabled = value
end
})
SilentAimSection:addToggle({
title = "Focus Mode",
default = Configuration.FocusMode,
callback = function(value)
Configuration.FocusMode = value
end
})
SilentAimSection:addToggle({
title = "Toggle Bind",
default = Configuration.ToggleBind,
callback = function(value)
Configuration.ToggleBind = value
end
})
SilentAimSection:addKeybind({
title = "Keybind",
default = Configuration.Keybind,
changedCallback = function(value)
Configuration.Keybind = value
end
})
SilentAimSection:addToggle({
title = "Focus Mode (Uses Keybind)",
default = Configuration.FocusMode,
callback = function(value)
Configuration.FocusMode = value
end
})
SilentAimSection:addKeybind({
title = "Focus Mode (Custom Bind)",
changedCallback = function(value)
Configuration.FocusMode = value
end
})