Nevzyn

Untitled

Dec 22nd, 2025
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.10 KB | None | 0 0
  1. -- init
  2. if not game:IsLoaded() then
  3. game.Loaded:Wait()
  4. end
  5.  
  6. if not syn or not protectgui then
  7. getgenv().protectgui = function() end
  8. end
  9.  
  10. local SilentAimSettings = {
  11. Enabled = false,
  12.  
  13. ClassName = "Universal Silent Aim - Averiias, Stefanuk12, xaxa",
  14. ToggleKey = "RightAlt",
  15.  
  16. TeamCheck = false,
  17. VisibleCheck = false,
  18. TargetPart = "HumanoidRootPart",
  19. SilentAimMethod = "Raycast",
  20.  
  21. FOVRadius = 130,
  22. FOVVisible = false,
  23. ShowSilentAimTarget = false,
  24.  
  25. MouseHitPrediction = false,
  26. MouseHitPredictionAmount = 0.165,
  27. HitChance = 100
  28. }
  29.  
  30. -- CORREÇÃO CRÍTICA: Era "Settings" agora é "SilentAimSettings"
  31. getgenv().SilentAimSettings = SilentAimSettings
  32.  
  33. local MainFileName = "UniversalSilentAim"
  34. local SelectedFile, FileToSave = "", ""
  35.  
  36. local Camera = workspace.CurrentCamera
  37. local Players = game:GetService("Players")
  38. local RunService = game:GetService("RunService")
  39. local GuiService = game:GetService("GuiService")
  40. local UserInputService = game:GetService("UserInputService")
  41. local HttpService = game:GetService("HttpService")
  42.  
  43. local LocalPlayer = Players.LocalPlayer
  44. local Mouse = LocalPlayer:GetMouse()
  45.  
  46. local GetChildren = game.GetChildren
  47. local GetPlayers = Players.GetPlayers
  48. local WorldToScreen = Camera.WorldToScreenPoint
  49. local WorldToViewportPoint = Camera.WorldToViewportPoint
  50. local GetPartsObscuringTarget = Camera.GetPartsObscuringTarget
  51. local FindFirstChild = game.FindFirstChild
  52. local RenderStepped = RunService.RenderStepped
  53. local GuiInset = GuiService.GetGuiInset
  54. local GetMouseLocation = UserInputService.GetMouseLocation
  55.  
  56. local resume = coroutine.resume
  57. local create = coroutine.create
  58.  
  59. local ValidTargetParts = {"Head", "HumanoidRootPart"}
  60. local PredictionAmount = 0.165
  61.  
  62. -- Detectar se é mobile
  63. local IsMobile = UserInputService.TouchEnabled and not UserInputService.MouseEnabled
  64.  
  65. local mouse_box = Drawing.new("Square")
  66. mouse_box.Visible = false -- CORRIGIDO: Inicia como false
  67. mouse_box.ZIndex = 999
  68. mouse_box.Color = Color3.fromRGB(54, 57, 241)
  69. mouse_box.Thickness = 20
  70. mouse_box.Size = Vector2.new(20, 20)
  71. mouse_box.Filled = true
  72.  
  73. local fov_circle = Drawing.new("Circle")
  74. fov_circle.Thickness = 1
  75. fov_circle.NumSides = 100
  76. fov_circle.Radius = 180
  77. fov_circle.Filled = false
  78. fov_circle.Visible = false
  79. fov_circle.ZIndex = 999
  80. fov_circle.Transparency = 1
  81. fov_circle.Color = Color3.fromRGB(54, 57, 241)
  82.  
  83. local ExpectedArguments = {
  84. FindPartOnRayWithIgnoreList = {
  85. ArgCountRequired = 3,
  86. Args = {
  87. "Instance", "Ray", "table", "boolean", "boolean"
  88. }
  89. },
  90. FindPartOnRayWithWhitelist = {
  91. ArgCountRequired = 3,
  92. Args = {
  93. "Instance", "Ray", "table", "boolean"
  94. }
  95. },
  96. FindPartOnRay = {
  97. ArgCountRequired = 2,
  98. Args = {
  99. "Instance", "Ray", "Instance", "boolean", "boolean"
  100. }
  101. },
  102. Raycast = {
  103. ArgCountRequired = 3,
  104. Args = {
  105. "Instance", "Vector3", "Vector3", "RaycastParams"
  106. }
  107. }
  108. }
  109.  
  110. function CalculateChance(Percentage)
  111. Percentage = math.floor(Percentage)
  112. local chance = math.floor(Random.new().NextNumber(Random.new(), 0, 1) * 100) / 100
  113. return chance <= Percentage / 100
  114. end
  115.  
  116. --[[file handling]] do
  117. if not isfolder(MainFileName) then
  118. makefolder(MainFileName)
  119. end
  120.  
  121. if not isfolder(string.format("%s/%s", MainFileName, tostring(game.PlaceId))) then
  122. makefolder(string.format("%s/%s", MainFileName, tostring(game.PlaceId)))
  123. end
  124. end
  125.  
  126. -- CORRIGIDO: Proteção contra erro se não houver arquivos
  127. local Files = {}
  128. pcall(function()
  129. Files = listfiles(string.format("%s/%s", "UniversalSilentAim", tostring(game.PlaceId)))
  130. end)
  131.  
  132. -- functions
  133. local function GetFiles()
  134. local out = {}
  135. for i = 1, #Files do
  136. local file = Files[i]
  137. if file:sub(-4) == '.lua' then
  138. local pos = file:find('.lua', 1, true)
  139. local start = pos
  140.  
  141. local char = file:sub(pos, pos)
  142. while char ~= '/' and char ~= '\\' and char ~= '' do
  143. pos = pos - 1
  144. char = file:sub(pos, pos)
  145. end
  146.  
  147. if char == '/' or char == '\\' then
  148. table.insert(out, file:sub(pos + 1, start - 1))
  149. end
  150. end
  151. end
  152.  
  153. return out
  154. end
  155.  
  156. local function UpdateFile(FileName)
  157. if not FileName or type(FileName) ~= "string" or FileName == "" then
  158. return warn("Nome de arquivo inválido")
  159. end
  160. writefile(string.format("%s/%s/%s.lua", MainFileName, tostring(game.PlaceId), FileName), HttpService:JSONEncode(SilentAimSettings))
  161. end
  162.  
  163. local function LoadFile(FileName)
  164. if not FileName or type(FileName) ~= "string" or FileName == "" then
  165. return warn("Nome de arquivo inválido")
  166. end
  167.  
  168. local File = string.format("%s/%s/%s.lua", MainFileName, tostring(game.PlaceId), FileName)
  169. local success, ConfigData = pcall(function()
  170. return HttpService:JSONDecode(readfile(File))
  171. end)
  172.  
  173. if success and ConfigData then
  174. for Index, Value in next, ConfigData do
  175. SilentAimSettings[Index] = Value
  176. end
  177. end
  178. end
  179.  
  180. local function getPositionOnScreen(Vector)
  181. local Vec3, OnScreen = WorldToScreen(Camera, Vector)
  182. return Vector2.new(Vec3.X, Vec3.Y), OnScreen
  183. end
  184.  
  185. local function ValidateArguments(Args, RayMethod)
  186. local Matches = 0
  187. if #Args < RayMethod.ArgCountRequired then
  188. return false
  189. end
  190. for Pos, Argument in next, Args do
  191. if typeof(Argument) == RayMethod.Args[Pos] then
  192. Matches = Matches + 1
  193. end
  194. end
  195. return Matches >= RayMethod.ArgCountRequired
  196. end
  197.  
  198. local function getDirection(Origin, Position)
  199. return (Position - Origin).Unit * 1000
  200. end
  201.  
  202. -- CORRIGIDO: Suporte para Mobile e PC
  203. local function getMousePosition()
  204. if IsMobile then
  205. local touch = UserInputService:GetTouchPosition()
  206. if touch and #touch > 0 then
  207. return touch[1]
  208. end
  209. return Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y / 2)
  210. else
  211. return GetMouseLocation(UserInputService)
  212. end
  213. end
  214.  
  215. local function IsPlayerVisible(Player)
  216. local PlayerCharacter = Player.Character
  217. local LocalPlayerCharacter = LocalPlayer.Character
  218.  
  219. if not (PlayerCharacter or LocalPlayerCharacter) then return end
  220.  
  221. local PlayerRoot = FindFirstChild(PlayerCharacter, SilentAimSettings.TargetPart) or FindFirstChild(PlayerCharacter, "HumanoidRootPart")
  222.  
  223. if not PlayerRoot then return end
  224.  
  225. local CastPoints, IgnoreList = {PlayerRoot.Position, LocalPlayerCharacter, PlayerCharacter}, {LocalPlayerCharacter, PlayerCharacter}
  226. local ObscuringObjects = #GetPartsObscuringTarget(Camera, CastPoints, IgnoreList)
  227.  
  228. return ((ObscuringObjects == 0 and true) or (ObscuringObjects > 0 and false))
  229. end
  230.  
  231. local function getClosestPlayer()
  232. if not SilentAimSettings.TargetPart then return end
  233. local Closest
  234. local DistanceToMouse
  235. for _, Player in next, GetPlayers(Players) do
  236. if Player == LocalPlayer then continue end
  237. if SilentAimSettings.TeamCheck and Player.Team == LocalPlayer.Team then continue end
  238.  
  239. local Character = Player.Character
  240. if not Character then continue end
  241.  
  242. if SilentAimSettings.VisibleCheck and not IsPlayerVisible(Player) then continue end
  243.  
  244. local HumanoidRootPart = FindFirstChild(Character, "HumanoidRootPart")
  245. local Humanoid = FindFirstChild(Character, "Humanoid")
  246. if not HumanoidRootPart or not Humanoid or Humanoid and Humanoid.Health <= 0 then continue end
  247.  
  248. local ScreenPosition, OnScreen = getPositionOnScreen(HumanoidRootPart.Position)
  249. if not OnScreen then continue end
  250.  
  251. local Distance = (getMousePosition() - ScreenPosition).Magnitude
  252. if Distance <= (DistanceToMouse or SilentAimSettings.FOVRadius or 2000) then
  253. Closest = ((SilentAimSettings.TargetPart == "Random" and Character[ValidTargetParts[math.random(1, #ValidTargetParts)]]) or Character[SilentAimSettings.TargetPart])
  254. DistanceToMouse = Distance
  255. end
  256. end
  257. return Closest
  258. end
  259.  
  260. -- ui creating & handling
  261. local Library = loadstring(game:HttpGet("https://raw.githubusercontent.com/violin-suzutsuki/LinoriaLib/main/Library.lua"))()
  262. local ThemeManager = loadstring(game:HttpGet("https://raw.githubusercontent.com/violin-suzutsuki/LinoriaLib/main/addons/ThemeManager.lua"))()
  263. local SaveManager = loadstring(game:HttpGet("https://raw.githubusercontent.com/violin-suzutsuki/LinoriaLib/main/addons/SaveManager.lua"))()
  264.  
  265. Library:SetWatermark("Universal Silent Aim | github.com/Averiias")
  266.  
  267. -- CORRIGIDO: Garantir que a UI seja criada corretamente
  268. local Window = Library:CreateWindow({
  269. Title = 'Universal Silent Aim',
  270. Center = true,
  271. AutoShow = true,
  272. TabPadding = 8,
  273. MenuFadeTime = 0.2
  274. })
  275.  
  276. -- Adicionar botão de toggle para mobile
  277. Library:Notify("Script carregado com sucesso! " .. (IsMobile and "(Modo Mobile)" or "(Modo PC)"))
  278.  
  279. local Tabs = {
  280. General = Window:AddTab("General"),
  281. ["UI Settings"] = Window:AddTab("UI Settings")
  282. }
  283.  
  284. local GeneralTab = Tabs.General
  285. local MainBOX = GeneralTab:AddLeftTabbox("Main") do
  286. local Main = MainBOX:AddTab("Main")
  287.  
  288. Main:AddToggle("aim_Enabled", {Text = "Enabled", Default = SilentAimSettings.Enabled}):AddKeyPicker("aim_Enabled_KeyPicker", {
  289. Default = "RightAlt",
  290. SyncToggleState = true,
  291. Mode = "Toggle",
  292. Text = "Enabled",
  293. NoUI = false
  294. })
  295.  
  296. Toggles.aim_Enabled:OnChanged(function()
  297. SilentAimSettings.Enabled = Toggles.aim_Enabled.Value
  298. mouse_box.Visible = SilentAimSettings.Enabled and SilentAimSettings.ShowSilentAimTarget
  299. end)
  300.  
  301. Options.aim_Enabled_KeyPicker:OnClick(function()
  302. SilentAimSettings.Enabled = not SilentAimSettings.Enabled
  303. Toggles.aim_Enabled:SetValue(SilentAimSettings.Enabled)
  304. mouse_box.Visible = SilentAimSettings.Enabled and SilentAimSettings.ShowSilentAimTarget
  305. end)
  306.  
  307. Main:AddToggle("TeamCheck", {Text = "Team Check", Default = SilentAimSettings.TeamCheck}):OnChanged(function()
  308. SilentAimSettings.TeamCheck = Toggles.TeamCheck.Value
  309. end)
  310.  
  311. Main:AddToggle("VisibleCheck", {Text = "Visible Check", Default = SilentAimSettings.VisibleCheck}):OnChanged(function()
  312. SilentAimSettings.VisibleCheck = Toggles.VisibleCheck.Value
  313. end)
  314.  
  315. Main:AddDropdown("TargetPart", {
  316. AllowNull = false,
  317. Text = "Target Part",
  318. Default = SilentAimSettings.TargetPart,
  319. Values = {"Head", "HumanoidRootPart", "Random"}
  320. }):OnChanged(function()
  321. SilentAimSettings.TargetPart = Options.TargetPart.Value
  322. end)
  323.  
  324. Main:AddDropdown("Method", {
  325. AllowNull = false,
  326. Text = "Silent Aim Method",
  327. Default = SilentAimSettings.SilentAimMethod,
  328. Values = {
  329. "Raycast",
  330. "FindPartOnRay",
  331. "FindPartOnRayWithWhitelist",
  332. "FindPartOnRayWithIgnoreList",
  333. "Mouse.Hit/Target"
  334. }
  335. }):OnChanged(function()
  336. SilentAimSettings.SilentAimMethod = Options.Method.Value
  337. end)
  338.  
  339. Main:AddSlider('HitChance', {
  340. Text = 'Hit chance',
  341. Default = SilentAimSettings.HitChance,
  342. Min = 0,
  343. Max = 100,
  344. Rounding = 1,
  345. Compact = false,
  346. }):OnChanged(function()
  347. SilentAimSettings.HitChance = Options.HitChance.Value
  348. end)
  349. end
  350.  
  351. local MiscellaneousBOX = GeneralTab:AddLeftTabbox("Miscellaneous")
  352. local PredictionTab = MiscellaneousBOX:AddTab("Prediction")
  353.  
  354. PredictionTab:AddToggle("Prediction", {
  355. Text = "Mouse.Hit/Target Prediction",
  356. Default = SilentAimSettings.MouseHitPrediction
  357. }):OnChanged(function()
  358. SilentAimSettings.MouseHitPrediction = Toggles.Prediction.Value
  359. end)
  360.  
  361. PredictionTab:AddSlider("Amount", {
  362. Text = "Prediction Amount",
  363. Min = 0.1,
  364. Max = 1,
  365. Default = SilentAimSettings.MouseHitPredictionAmount,
  366. Rounding = 3
  367. }):OnChanged(function()
  368. PredictionAmount = Options.Amount.Value
  369. SilentAimSettings.MouseHitPredictionAmount = Options.Amount.Value
  370. end)
  371.  
  372. local FieldOfViewBOX = GeneralTab:AddRightTabbox("Field Of View") do
  373. local Main = FieldOfViewBOX:AddTab("Visuals")
  374.  
  375. Main:AddToggle("Visible", {
  376. Text = "Show FOV Circle",
  377. Default = SilentAimSettings.FOVVisible
  378. }):AddColorPicker("Color", {
  379. Default = Color3.fromRGB(54, 57, 241)
  380. })
  381.  
  382. Toggles.Visible:OnChanged(function()
  383. fov_circle.Visible = Toggles.Visible.Value
  384. SilentAimSettings.FOVVisible = Toggles.Visible.Value
  385. end)
  386.  
  387. Options.Color:OnChanged(function()
  388. fov_circle.Color = Options.Color.Value
  389. end)
  390.  
  391. Main:AddSlider("Radius", {
  392. Text = "FOV Circle Radius",
  393. Min = 0,
  394. Max = 360,
  395. Default = SilentAimSettings.FOVRadius,
  396. Rounding = 0
  397. }):OnChanged(function()
  398. fov_circle.Radius = Options.Radius.Value
  399. SilentAimSettings.FOVRadius = Options.Radius.Value
  400. end)
  401.  
  402. Main:AddToggle("MousePosition", {
  403. Text = "Show Silent Aim Target",
  404. Default = SilentAimSettings.ShowSilentAimTarget
  405. }):AddColorPicker("MouseVisualizeColor", {
  406. Default = Color3.fromRGB(54, 57, 241)
  407. })
  408.  
  409. Toggles.MousePosition:OnChanged(function()
  410. SilentAimSettings.ShowSilentAimTarget = Toggles.MousePosition.Value
  411. if not Toggles.MousePosition.Value then
  412. mouse_box.Visible = false
  413. end
  414. end)
  415.  
  416. Options.MouseVisualizeColor:OnChanged(function()
  417. mouse_box.Color = Options.MouseVisualizeColor.Value
  418. end)
  419. end
  420.  
  421. local CreateConfigurationBOX = GeneralTab:AddRightTabbox("Create Configuration") do
  422. local Main = CreateConfigurationBOX:AddTab("Create")
  423.  
  424. Main:AddInput("CreateConfigTextBox", {
  425. Default = "",
  426. Numeric = false,
  427. Finished = false,
  428. Text = "Configuration Name",
  429. Tooltip = "Creates a configuration file",
  430. Placeholder = "File Name here"
  431. }):OnChanged(function()
  432. if Options.CreateConfigTextBox.Value and string.len(Options.CreateConfigTextBox.Value) ~= 0 then
  433. FileToSave = Options.CreateConfigTextBox.Value
  434. end
  435. end)
  436.  
  437. Main:AddButton("Create Configuration File", function()
  438. if FileToSave ~= "" and FileToSave ~= nil then
  439. UpdateFile(FileToSave)
  440. Library:Notify("Configuration '" .. FileToSave .. "' created!")
  441. -- Atualizar lista de arquivos
  442. Files = listfiles(string.format("%s/%s", "UniversalSilentAim", tostring(game.PlaceId)))
  443. Options.SaveConfigurationDropdown:SetValues(GetFiles())
  444. Options.LoadConfigurationDropdown:SetValues(GetFiles())
  445. else
  446. Library:Notify("Please enter a file name!")
  447. end
  448. end)
  449. end
  450.  
  451. local SaveConfigurationBOX = GeneralTab:AddRightTabbox("Save Configuration") do
  452. local Main = SaveConfigurationBOX:AddTab("Save")
  453.  
  454. Main:AddDropdown("SaveConfigurationDropdown", {
  455. AllowNull = true,
  456. Values = GetFiles(),
  457. Text = "Choose Configuration to Save"
  458. })
  459.  
  460. Main:AddButton("Save Configuration", function()
  461. if Options.SaveConfigurationDropdown.Value and Options.SaveConfigurationDropdown.Value ~= "" then
  462. UpdateFile(Options.SaveConfigurationDropdown.Value)
  463. Library:Notify("Configuration '" .. Options.SaveConfigurationDropdown.Value .. "' saved!")
  464. else
  465. Library:Notify("Please select a configuration!")
  466. end
  467. end)
  468.  
  469. Main:AddButton("Refresh List", function()
  470. Files = listfiles(string.format("%s/%s", "UniversalSilentAim", tostring(game.PlaceId)))
  471. Options.SaveConfigurationDropdown:SetValues(GetFiles())
  472. Options.LoadConfigurationDropdown:SetValues(GetFiles())
  473. Library:Notify("Configuration list refreshed!")
  474. end)
  475. end
  476.  
  477. local LoadConfigurationBOX = GeneralTab:AddRightTabbox("Load Configuration") do
  478. local Main = LoadConfigurationBOX:AddTab("Load")
  479.  
  480. Main:AddDropdown("LoadConfigurationDropdown", {
  481. AllowNull = true,
  482. Values = GetFiles(),
  483. Text = "Choose Configuration to Load"
  484. })
  485.  
  486. Main:AddButton("Load Configuration", function()
  487. if Options.LoadConfigurationDropdown.Value and table.find(GetFiles(), Options.LoadConfigurationDropdown.Value) then
  488. LoadFile(Options.LoadConfigurationDropdown.Value)
  489.  
  490. -- Atualizar UI com valores carregados
  491. Toggles.aim_Enabled:SetValue(SilentAimSettings.Enabled)
  492. Toggles.TeamCheck:SetValue(SilentAimSettings.TeamCheck)
  493. Toggles.VisibleCheck:SetValue(SilentAimSettings.VisibleCheck)
  494. Options.TargetPart:SetValue(SilentAimSettings.TargetPart)
  495. Options.Method:SetValue(SilentAimSettings.SilentAimMethod)
  496. Toggles.Visible:SetValue(SilentAimSettings.FOVVisible)
  497. Options.Radius:SetValue(SilentAimSettings.FOVRadius)
  498. Toggles.MousePosition:SetValue(SilentAimSettings.ShowSilentAimTarget)
  499. Toggles.Prediction:SetValue(SilentAimSettings.MouseHitPrediction)
  500. Options.Amount:SetValue(SilentAimSettings.MouseHitPredictionAmount)
  501. Options.HitChance:SetValue(SilentAimSettings.HitChance)
  502.  
  503. Library:Notify("Configuration '" .. Options.LoadConfigurationDropdown.Value .. "' loaded!")
  504. else
  505. Library:Notify("Please select a valid configuration!")
  506. end
  507. end)
  508. end
  509.  
  510. -- UI Settings Tab
  511. ThemeManager:SetLibrary(Library)
  512. SaveManager:SetLibrary(Library)
  513.  
  514. ThemeManager:SetFolder("UniversalSilentAim")
  515. SaveManager:SetFolder("UniversalSilentAim/" .. tostring(game.PlaceId))
  516.  
  517. SaveManager:BuildConfigSection(Tabs["UI Settings"])
  518. ThemeManager:ApplyToTab(Tabs["UI Settings"])
  519.  
  520. -- Inicializar valores padrão
  521. task.spawn(function()
  522. task.wait(0.5)
  523. Toggles.aim_Enabled:SetValue(SilentAimSettings.Enabled)
  524. Options.TargetPart:SetValue(SilentAimSettings.TargetPart)
  525. Options.Method:SetValue(SilentAimSettings.SilentAimMethod)
  526. Options.Radius:SetValue(SilentAimSettings.FOVRadius)
  527. Options.HitChance:SetValue(SilentAimSettings.HitChance)
  528. end)
  529.  
  530. -- Visual Update Loop
  531. resume(create(function()
  532. RenderStepped:Connect(function()
  533. -- Atualizar visualização do alvo
  534. if SilentAimSettings.ShowSilentAimTarget and SilentAimSettings.Enabled then
  535. local closestPlayer = getClosestPlayer()
  536. if closestPlayer then
  537. local Root = closestPlayer.Parent.PrimaryPart or closestPlayer.Parent:FindFirstChild("HumanoidRootPart")
  538. if Root then
  539. local RootToViewportPoint, IsOnScreen = WorldToViewportPoint(Camera, Root.Position)
  540.  
  541. mouse_box.Visible = IsOnScreen
  542. mouse_box.Position = Vector2.new(RootToViewportPoint.X - 10, RootToViewportPoint.Y - 10)
  543. else
  544. mouse_box.Visible = false
  545. end
  546. else
  547. mouse_box.Visible = false
  548. end
  549. else
  550. mouse_box.Visible = false
  551. end
  552.  
  553. -- Atualizar FOV Circle
  554. if SilentAimSettings.FOVVisible then
  555. fov_circle.Visible = true
  556. fov_circle.Position = getMousePosition()
  557. else
  558. fov_circle.Visible = false
  559. end
  560. end)
  561. end))
  562.  
  563. -- hooks
  564. local oldNamecall
  565. oldNamecall = hookmetamethod(game, "__namecall", newcclosure(function(...)
  566. local Method = getnamecallmethod()
  567. local Arguments = {...}
  568. local self = Arguments[1]
  569. local chance = CalculateChance(SilentAimSettings.HitChance)
  570.  
  571. if SilentAimSettings.Enabled and self == workspace and not checkcaller() and chance then
  572. if Method == "FindPartOnRayWithIgnoreList" and SilentAimSettings.SilentAimMethod == Method then
  573. if ValidateArguments(Arguments, ExpectedArguments.FindPartOnRayWithIgnoreList) then
  574. local A_Ray = Arguments[2]
  575. local HitPart = getClosestPlayer()
  576.  
  577. if HitPart then
  578. local Origin = A_Ray.Origin
  579. local Direction = getDirection(Origin, HitPart.Position)
  580. Arguments[2] = Ray.new(Origin, Direction)
  581. return oldNamecall(unpack(Arguments))
  582. end
  583. end
  584. elseif Method == "FindPartOnRayWithWhitelist" and SilentAimSettings.SilentAimMethod == Method then
  585. if ValidateArguments(Arguments, ExpectedArguments.FindPartOnRayWithWhitelist) then
  586. local A_Ray = Arguments[2]
  587. local HitPart = getClosestPlayer()
  588.  
  589. if HitPart then
  590. local Origin = A_Ray.Origin
  591. local Direction = getDirection(Origin, HitPart.Position)
  592. Arguments[2] = Ray.new(Origin, Direction)
  593. return oldNamecall(unpack(Arguments))
  594. end
  595. end
  596. elseif (Method == "FindPartOnRay" or Method == "findPartOnRay") and SilentAimSettings.SilentAimMethod:lower() == Method:lower() then
  597. if ValidateArguments(Arguments, ExpectedArguments.FindPartOnRay) then
  598. local A_Ray = Arguments[2]
  599. local HitPart = getClosestPlayer()
  600.  
  601. if HitPart then
  602. local Origin = A_Ray.Origin
  603. local Direction = getDirection(Origin, HitPart.Position)
  604. Arguments[2] = Ray.new(Origin, Direction)
  605. return oldNamecall(unpack(Arguments))
  606. end
  607. end
  608. elseif Method == "Raycast" and SilentAimSettings.SilentAimMethod == Method then
  609. if ValidateArguments(Arguments, ExpectedArguments.Raycast) then
  610. local A_Origin = Arguments[2]
  611. local HitPart = getClosestPlayer()
  612.  
  613. if HitPart then
  614. Arguments[3] = getDirection(A_Origin, HitPart.Position)
  615. return oldNamecall(unpack(Arguments))
  616. end
  617. end
  618. end
  619. end
  620. return oldNamecall(...)
  621. end))
  622.  
  623. local oldIndex = nil
  624. oldIndex = hookmetamethod(game, "__index", newcclosure(function(self, Index)
  625. if self == Mouse and not checkcaller() and SilentAimSettings.Enabled and SilentAimSettings.SilentAimMethod == "Mouse.Hit/Target" then
  626. local HitPart = getClosestPlayer()
  627.  
  628. if HitPart then
  629. if Index == "Target" or Index == "target" then
  630. return HitPart
  631. elseif Index == "Hit" or Index == "hit" then
  632. if SilentAimSettings.MouseHitPrediction then
  633. return (HitPart.CFrame + (HitPart.Velocity * PredictionAmount))
  634. else
  635. return HitPart.CFrame
  636. end
  637. elseif Index == "X" then
  638. local screenPos = WorldToViewportPoint(Camera, HitPart.Position)
  639. return screenPos.X
  640. elseif Index == "Y" then
  641. local screenPos = WorldToViewportPoint(Camera, HitPart.Position)
  642. return screenPos.Y
  643. elseif Index == "UnitRay" then
  644. local Origin = Camera.CFrame.Position
  645. local Direction = (HitPart.Position - Origin).Unit
  646. return Ray.new(Origin, Direction * 1000)
  647. end
  648. end
  649. end
  650.  
  651. return oldIndex(self, Index)
  652. end))
  653.  
  654. -- Notificação final
  655. Library:Notify("Silent Aim loaded successfully! Press " .. (IsMobile and "RightShift" or "RightAlt") .. " to toggle")
  656.  
  657. print("===========================================")
  658. print("Universal Silent Aim - Loaded Successfully!")
  659. print("Mode: " .. (IsMobile and "Mobile" or "PC"))
  660. print("Toggle Key: " .. (IsMobile and "RightShift" or "RightAlt"))
  661. print("===========================================")
Advertisement
Add Comment
Please, Sign In to add comment