Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- 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 Library, AimingTab, _ = 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 = "FindPartOnRay",
- 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,
- MethodResolve = {
- -- // __namecall methods
- raycast = {
- Real = "Raycast",
- Metamethod = "__namecall",
- Aliases = {"raycast"}
- },
- findpartonray = {
- Real = "FindPartOnRay",
- Metamethod = "__namecall",
- Aliases = {"findPartOnRay"}
- },
- findpartonraywithwhitelist = {
- Real = "FindPartOnRayWithWhitelist",
- Metamethod = "__namecall",
- Aliases = {"findPartOnRayWithWhitelist"}
- },
- findpartonraywithignorelist = {
- Real = "FindPartOnRayWithIgnoreList",
- Metamethod = "__namecall",
- Aliases = {"findPartOnRayWithIgnoreList"}
- },
- -- // __index methods
- target = {
- Real = "Target",
- Metamethod = "__index",
- Aliases = {"target"}
- },
- hit = {
- Real = "Hit",
- Metamethod = "__index",
- Aliases = {"hit"}
- },
- x = {
- Real = "X",
- Metamethod = "__index",
- Aliases = {"x"}
- },
- y = {
- Real = "Y",
- Metamethod = "__index",
- Aliases = {"y"}
- },
- unitray = {
- Real = "UnitRay",
- Metamethod = "__index",
- Aliases = {"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
- -- // Validate arguments passed through namecall
- local function ValidateArguments(Args, Method)
- --// Get Type Information from Method
- local TypeInformation = Configuration.ExpectedArguments[Method]
- if (not TypeInformation) then
- return false
- end
- --// Make new table for successful matches
- local Matches = 0
- -- // Go through every argument passed
- for ArgumentPosition, Argument in pairs(Args) do
- -- // Check if argument type is a certain type
- if (typeof(Argument) == TypeInformation.Args[ArgumentPosition]) then
- Matches = Matches + 1
- end
- end
- -- // Get information
- local ExpectedValid = #Args
- local GotValid = Matches
- -- // Return whether or not arguments are valid
- return ExpectedValid == GotValid
- end
- -- // Additional checks you can add yourself, e.g. upvalue checks
- function Configuration.AdditionalCheck(metamethod, method, callingscript, ...)
- return true
- end
- -- // Checks if a certain method is enabled
- local stringsplit = string.split
- local stringlower = string.lower
- local tablefind = table.find
- local function IsMethodEnabled(Method, Given, PossibleMethods)
- -- // Split it all up
- PossibleMethods = PossibleMethods or stringsplit(Configuration.Method, ",")
- Given = Given or Method
- -- // Vars
- local LoweredMethod = stringlower(Method)
- local MethodData = Configuration.MethodResolve[LoweredMethod]
- if (not MethodData) then
- return false, nil
- end
- -- //
- local Matches = LoweredMethod == stringlower(Given)
- local RealMethod = MethodData.Real
- local Found = tablefind(PossibleMethods, RealMethod)
- -- // Return
- return (Matches and Found), RealMethod
- end
- -- // Allows you to easily toggle multiple methods on and off
- function Configuration.ToggleMethod(Method, State)
- -- // Vars
- local EnabledMethods = Configuration.Method:split(",")
- local FoundI = table.find(EnabledMethods, Method)
- -- //
- 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
- -- // Modify the position/cframe, add prediction yourself (use Aiming.Selected)
- function Configuration.ModifyCFrame(OnScreen)
- return OnScreen and AimingSelected.Position or AimingSelected.Part.CFrame
- 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
- -- // Disable whitelist mode
- AimingSettingsIgnoredWhitelistMode.Players = false
- end
- -- // Unfocuses everything
- function Configuration.UnfocusAll(Replacement)
- Replacement = Replacement or Backup
- AimingSettingsIgnored.Players = Replacement
- AimingSettingsIgnoredWhitelistMode.Players = false
- 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
- -- // For the toggle and stuff
- local function CheckInput(Input, Expected)
- local InputType = Expected.EnumType == Enum.KeyCode and "KeyCode" or "UserInputType"
- return Input[InputType] == Expected
- end
- UserInputService.InputBegan:Connect(function(Input, GameProcessedEvent)
- -- // Make sure is not processed
- if (GameProcessedEvent) then
- return
- end
- -- // Check if matches bind
- local FocusMode = Configuration.FocusMode
- if (CheckInput(Input, Configuration.Keybind)) then
- if (Configuration.ToggleBind) then
- IsToggled = not IsToggled
- else
- IsToggled = true
- end
- if (FocusMode == true) then
- Configuration.FocusHandler()
- end
- 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 __index
- __index = hookmetamethod(game, "__index", function(t, k)
- -- // Vars
- local callingscript = getcallingscript()
- -- // Make sure everything is in order
- if (t:IsA("Mouse") and not checkcaller() and IsToggled and Configuration.Enabled and AimingChecks.IsAvailable()) then
- -- // Vars
- local MethodEnabled, RealMethod = IsMethodEnabled(k)
- -- // Make sure everything is in order 2
- if (not MethodEnabled or not Configuration.AdditionalCheck("__index", nil, callingscript, t, RealMethod)) then
- return __index(t, k)
- end
- -- // Target
- if (RealMethod == "Target") then
- return AimingSelected.Part
- end
- -- // Hit
- if (RealMethod == "Hit") then
- return Configuration.ModifyCFrame(false)
- end
- -- // X/Y
- if (RealMethod == "X" or RealMethod == "Y") then
- return Configuration.ModifyCFrame(true)[k]
- end
- -- // UnitRay
- if (RealMethod == "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)
- local __namecall
- __namecall = hookmetamethod(game, "__namecall", function(...)
- -- // Vars
- local args = {...}
- local self = args[1]
- local method = getnamecallmethod()
- local callingscript = getcallingscript()
- -- // Make sure everything is in order
- if (self == workspace and not checkcaller() and IsToggled and Configuration.Enabled and AimingChecks.IsAvailable()) then
- -- // Vars
- local MethodEnabled, RealMethod = IsMethodEnabled(method)
- -- // Make sure all is in order 2
- if (not MethodEnabled or not ValidateArguments(args, RealMethod) and Configuration.AdditionalCheck("__namecall", RealMethod, callingscript, ...)) then
- return __namecall(...)
- end
- -- // Raycast
- if (RealMethod == "Raycast") then
- -- // Modify args
- args[3] = CalculateDirection(args[2], Configuration.ModifyCFrame(false).Position, 1000)
- -- // Return
- return __namecall(unpack(args))
- end
- -- // The rest pretty much, modify args
- local Origin = args[2].Origin
- local Direction = CalculateDirection(Origin, __index(AimingSelected.Part, "Position"), 1000)
- args[2] = Ray.new(Origin, Direction)
- -- // Return
- return __namecall(unpack(args))
- end
- -- //
- return __namecall(...)
- end)
- -- // GUI
- local SilentAimGroupBox = AimingTab:AddLeftTabbox("Silent Aim")
- local MainTab = SilentAimGroupBox:AddTab("Main")
- local MethodsTab = SilentAimGroupBox:AddTab("Methods")
- MainTab:AddToggle("SilentAimEnabled", {
- Text = "Enabled",
- Default = Configuration.Enabled,
- Tooltip = "Toggle the Silent Aim on and off",
- Callback = function(Value)
- Configuration.Enabled = Value
- end
- }):AddKeyPicker("SilentAimEnabledKey", {
- Default = Configuration.Keybind,
- SyncToggleState = false,
- Mode = Configuration.ToggleBind and "Toggle" or "Hold",
- Text = "Silent Aim",
- NoUI = false,
- ChangedCallback = function(Key)
- Configuration.Keybind = Key
- end
- })
- MainTab:AddToggle("SilentAimEnabledToggle", {
- Text = "Toggle Mode",
- Default = Configuration.ToggleBind,
- Tooltip = "When disabled, it is hold to activate.",
- Callback = function(Value)
- Configuration.ToggleBind = Value
- Options.SilentAimEnabledKey.Mode = Value and "Toggle" or "Hold"
- Options.SilentAimEnabledKey:Update()
- end
- })
- MainTab:AddToggle("SilentAimFocusMode", {
- Text = "Focus Mode",
- Default = Configuration.Enabled,
- Tooltip = "Only targets the current targetted player",
- Callback = function(Value)
- Configuration.FocusMode = Value
- end
- }):AddKeyPicker("SilentAimFocusModeKey", {
- Default = Configuration.Keybind,
- SyncToggleState = false,
- Text = "Focus Mode",
- NoUI = false,
- ChangedCallback = function(Key)
- Configuration.FocusMode = Key
- end
- })
- -- // Adding each method
- local Methods = {}
- for _, method in pairs(Configuration.MethodResolve) do
- table.insert(Methods, method.Real)
- end
- -- //
- local function GetDictKeys(Dictionary)
- local Keys = {}
- for key, _ in pairs(Dictionary) do
- table.insert(Keys, key)
- end
- return Keys
- end
- MethodsTab:AddDropdown("SilentAimMethods", {
- Values = Methods,
- Default = Configuration.Method:split(","),
- Multi = true,
- Text = "Methods",
- Tooltip = "The possible silent aim methods to enable",
- Callback = function(Value)
- Configuration.Method = table.concat(GetDictKeys(Value), ",")
- end
- })
- Library.KeybindFrame.Visible = true;
- local function API_Check()
- if Drawing == nil then
- return "No"
- else
- return "Yes"
- end
- end
- local Find_Required = API_Check()
- if Find_Required == "No" then
- game:GetService("StarterGui"):SetCore("SendNotification",{
- Title = "Exunys Developer";
- Text = "ESP script could not be loaded because your exploit is unsupported.";
- Duration = math.huge;
- Button1 = "OK"
- })
- return
- end
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local UserInputService = game:GetService("UserInputService")
- local Camera = workspace.CurrentCamera
- local Typing = false
- _G.SendNotifications = true -- If set to true then the script would notify you frequently on any changes applied and when loaded / errored. (If a game can detect this, it is recommended to set it to false)
- _G.DefaultSettings = false -- If set to true then the ESP script would run with default settings regardless of any changes you made.
- _G.TeamCheck = false -- If set to true then the script would create ESP only for the enemy team members.
- _G.ESPVisible = true -- If set to true then the ESP will be visible and vice versa.
- _G.TextColor = Color3.fromRGB(255, 80, 10) -- The color that the boxes would appear as.
- _G.TextSize = 14 -- The size of the text.
- _G.Center = true -- If set to true then the script would be located at the center of the label.
- _G.Outline = true -- If set to true then the text would have an outline.
- _G.OutlineColor = Color3.fromRGB(0, 0, 0) -- The outline color of the text.
- _G.TextTransparency = 0.7 -- The transparency of the text.
- _G.TextFont = Drawing.Fonts.UI -- The font of the text. (UI, System, Plex, Monospace)
- _G.DisableKey = Enum.KeyCode.Q -- The key that disables / enables the ESP.
- local function CreateESP()
- for _, v in next, Players:GetPlayers() do
- if v.Name ~= Players.LocalPlayer.Name then
- local ESP = Drawing.new("Text")
- RunService.RenderStepped:Connect(function()
- if workspace:FindFirstChild(v.Name) ~= nil and workspace[v.Name]:FindFirstChild("HumanoidRootPart") ~= nil then
- local Vector, OnScreen = Camera:WorldToViewportPoint(workspace[v.Name]:WaitForChild("Head", math.huge).Position)
- ESP.Size = _G.TextSize
- ESP.Center = _G.Center
- ESP.Outline = _G.Outline
- ESP.OutlineColor = _G.OutlineColor
- ESP.Color = _G.TextColor
- ESP.Transparency = _G.TextTransparency
- ESP.Font = _G.TextFont
- if OnScreen == true then
- local Part1 = workspace:WaitForChild(v.Name, math.huge):WaitForChild("HumanoidRootPart", math.huge).Position
- local Part2 = workspace:WaitForChild(Players.LocalPlayer.Name, math.huge):WaitForChild("HumanoidRootPart", math.huge).Position or 0
- local Dist = (Part1 - Part2).Magnitude
- ESP.Position = Vector2.new(Vector.X, Vector.Y - 25)
- ESP.Text = ("("..tostring(math.floor(tonumber(Dist)))..") "..v.Name.." ["..workspace[v.Name].Humanoid.Health.."]")
- if _G.TeamCheck == true then
- if Players.LocalPlayer.Team ~= v.Team then
- ESP.Visible = _G.ESPVisible
- else
- ESP.Visible = false
- end
- else
- ESP.Visible = _G.ESPVisible
- end
- else
- ESP.Visible = false
- end
- else
- ESP.Visible = false
- end
- end)
- Players.PlayerRemoving:Connect(function()
- ESP.Visible = false
- end)
- end
- end
- Players.PlayerAdded:Connect(function(Player)
- Player.CharacterAdded:Connect(function(v)
- if v.Name ~= Players.LocalPlayer.Name then
- local ESP = Drawing.new("Text")
- RunService.RenderStepped:Connect(function()
- if workspace:FindFirstChild(v.Name) ~= nil and workspace[v.Name]:FindFirstChild("HumanoidRootPart") ~= nil then
- local Vector, OnScreen = Camera:WorldToViewportPoint(workspace[v.Name]:WaitForChild("Head", math.huge).Position)
- ESP.Size = _G.TextSize
- ESP.Center = _G.Center
- ESP.Outline = _G.Outline
- ESP.OutlineColor = _G.OutlineColor
- ESP.Color = _G.TextColor
- ESP.Transparency = _G.TextTransparency
- if OnScreen == true then
- local Part1 = workspace:WaitForChild(v.Name, math.huge):WaitForChild("HumanoidRootPart", math.huge).Position
- local Part2 = workspace:WaitForChild(Players.LocalPlayer.Name, math.huge):WaitForChild("HumanoidRootPart", math.huge).Position or 0
- local Dist = (Part1 - Part2).Magnitude
- ESP.Position = Vector2.new(Vector.X, Vector.Y - 25)
- ESP.Text = ("("..tostring(math.floor(tonumber(Dist)))..") "..v.Name.." ["..workspace[v.Name].Humanoid.Health.."]")
- if _G.TeamCheck == true then
- if Players.LocalPlayer.Team ~= Player.Team then
- ESP.Visible = _G.ESPVisible
- else
- ESP.Visible = false
- end
- else
- ESP.Visible = _G.ESPVisible
- end
- else
- ESP.Visible = false
- end
- else
- ESP.Visible = false
- end
- end)
- Players.PlayerRemoving:Connect(function()
- ESP.Visible = false
- end)
- end
- end)
- end)
- end
- if _G.DefaultSettings == true then
- _G.TeamCheck = false
- _G.ESPVisible = true
- _G.TextColor = Color3.fromRGB(40, 90, 255)
- _G.TextSize = 14
- _G.Center = true
- _G.Outline = false
- _G.OutlineColor = Color3.fromRGB(0, 0, 0)
- _G.DisableKey = Enum.KeyCode.O
- _G.TextTransparency = 0.75
- end
- UserInputService.TextBoxFocused:Connect(function()
- Typing = true
- end)
- UserInputService.TextBoxFocusReleased:Connect(function()
- Typing = false
- end)
- UserInputService.InputBegan:Connect(function(Input)
- if Input.KeyCode == _G.DisableKey and Typing == false then
- _G.ESPVisible = not _G.ESPVisible
- if _G.SendNotifications == true then
- game:GetService("StarterGui"):SetCore("SendNotification",{
- Title = "Exunys Developer";
- Text = "The ESP's visibility is now set to "..tostring(_G.ESPVisible)..".";
- Duration = 5;
- })
- end
- end
- end)
- local Success, Errored = pcall(function()
- CreateESP()
- end)
- if Success and not Errored then
- if _G.SendNotifications == true then
- game:GetService("StarterGui"):SetCore("SendNotification",{
- Title = "Exunys Developer";
- Text = "ESP script has successfully loaded.";
- Duration = 5;
- })
- end
- elseif Errored and not Success then
- if _G.SendNotifications == true then
- game:GetService("StarterGui"):SetCore("SendNotification",{
- Title = "Exunys Developer";
- Text = "ESP script has errored while loading, please check the developer console! (F9)";
- Duration = 5;
- })
- end
- TestService:Message("The ESP script has errored, please notify Exunys with the following information :")
- warn(Errored)
- print("!! IF THE ERROR IS A FALSE POSITIVE (says that a player cannot be found) THEN DO NOT BOTHER !!")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement