local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Workspace = game:GetService("Workspace")
local CONFIG = {
Players = true,
Animals = true,
NPCs = true
}
local Entities = Workspace:FindFirstChild("WORKSPACE_Entities")
if not Entities then
return
end
local PlayersFolder = Entities:FindFirstChild("Players")
local AnimalsFolder = Entities:FindFirstChild("Animals")
local NPCsFolder = Entities:FindFirstChild("NPCs")
local localPlayer = Players.LocalPlayer
local function getTargetPosition(origin)
local camera = workspace.CurrentCamera
local mousePos = UserInputService:GetMouseLocation()
local character = localPlayer.Character
local hrpChar = character and character:FindFirstChild("HumanoidRootPart")
local charPos = hrpChar and hrpChar.Position or origin
local charLook = hrpChar and hrpChar.CFrame.LookVector or camera.CFrame.LookVector
local closestDist = math.huge
local targetPos = nil
local function processTarget(part, aimPosition)
if not part or not aimPosition then return end
local toTarget = (aimPosition - charPos).Unit
if charLook:Dot(toTarget) > 0 then
local screenPos, onScreen = camera:WorldToScreenPoint(aimPosition)
if onScreen and screenPos.Z > 0 then
local dist = (Vector2.new(screenPos.X, screenPos.Y) - mousePos).Magnitude
if dist < closestDist then
closestDist = dist
targetPos = aimPosition
end
end
end
end
if CONFIG.Players and PlayersFolder then
for _, model in ipairs(PlayersFolder:GetChildren()) do
if model ~= character then
local hrp = model:FindFirstChild("HumanoidRootPart")
if hrp then
local aimPos
local head = model:FindFirstChild("Head")
if head then
aimPos = head.Position - Vector3.new(0, 1, 0)
else
aimPos = hrp.Position
end
processTarget(hrp, aimPos)
end
end
end
end
if CONFIG.Animals and AnimalsFolder then
for _, model in ipairs(AnimalsFolder:GetChildren()) do
if model:IsA("Model") then
local hrp = model:FindFirstChild("HumanoidRootPart")
if hrp then
processTarget(hrp, hrp.Position)
end
end
end
end
if CONFIG.NPCs and NPCsFolder then
for _, descendant in ipairs(NPCsFolder:GetDescendants()) do
if descendant:IsA("Model") then
local hrp = descendant:FindFirstChild("HumanoidRootPart")
if hrp then
processTarget(hrp, hrp.Position)
end
end
end
end
if closestDist > 1000 then
return nil
end
return targetPos
end
local ProjectileHandler = require(ReplicatedStorage.SharedModules.World.ProjectileHandler)
local oldGetSpread = ProjectileHandler.GetProjectileSpread
ProjectileHandler.GetProjectileSpread = function(self, projectileType, projectileParams, info, numProjectiles)
if info and info.origin then
local targetPos = getTargetPosition(info.origin)
if targetPos then
local newDir = (targetPos - info.origin).Unit
info.direction = newDir
end
end
return oldGetSpread(self, projectileType, projectileParams, info, numProjectiles)
end
local oldInit = ProjectileHandler.InitProjectiles
ProjectileHandler.InitProjectiles = function(self, projectileType, projectileParams, info, callback)
if info and info.origin then
local targetPos = getTargetPosition(info.origin)
if targetPos then
local newDir = (targetPos - info.origin).Unit
info.direction = newDir
end
end
return oldInit(self, projectileType, projectileParams, info, callback)
endsilent aim script for The Wild West
locks onto targets without looking obvious, shots go where they should even if your aim isn’t perfect. feels smooth in fights and helps a lot in gun duels
not super flashy or overloaded, just a clean silent aim that does its job consistently
No comments yet. Be the first to comment!
1local Players = game:GetService("Players")
2local UserInputService = game:GetService("UserInputService")
3local ReplicatedStorage = game:GetService("ReplicatedStorage")
4local Workspace = game:GetService("Workspace")
5
6local CONFIG = {
7 Players = true,
8 Animals = true,
9 NPCs = true
10}
11
12local Entities = Workspace:FindFirstChild("WORKSPACE_Entities")
13if not Entities then
14 return
15end
16
17local PlayersFolder = Entities:FindFirstChild("Players")
18local AnimalsFolder = Entities:FindFirstChild("Animals")
19local NPCsFolder = Entities:FindFirstChild("NPCs")
20
21local localPlayer = Players.LocalPlayer
22
23local function getTargetPosition(origin)
24 local camera = workspace.CurrentCamera
25 local mousePos = UserInputService:GetMouseLocation()
26 local character = localPlayer.Character
27 local hrpChar = character and character:FindFirstChild("HumanoidRootPart")
28 local charPos = hrpChar and hrpChar.Position or origin
29 local charLook = hrpChar and hrpChar.CFrame.LookVector or camera.CFrame.LookVector
30
31 local closestDist = math.huge
32 local targetPos = nil
33
34 local function processTarget(part, aimPosition)
35 if not part or not aimPosition then return end
36 local toTarget = (aimPosition - charPos).Unit
37 if charLook:Dot(toTarget) > 0 then
38 local screenPos, onScreen = camera:WorldToScreenPoint(aimPosition)
39 if onScreen and screenPos.Z > 0 then
40 local dist = (Vector2.new(screenPos.X, screenPos.Y) - mousePos).Magnitude
41 if dist < closestDist then
42 closestDist = dist
43 targetPos = aimPosition
44 end
45 end
46 end
47 end
48
49 if CONFIG.Players and PlayersFolder then
50 for _, model in ipairs(PlayersFolder:GetChildren()) do
51 if model ~= character then
52 local hrp = model:FindFirstChild("HumanoidRootPart")
53 if hrp then
54 local aimPos
55 local head = model:FindFirstChild("Head")
56 if head then
57 aimPos = head.Position - Vector3.new(0, 1, 0)
58 else
59 aimPos = hrp.Position
60 end
61 processTarget(hrp, aimPos)
62 end
63 end
64 end
65 end
66
67 if CONFIG.Animals and AnimalsFolder then
68 for _, model in ipairs(AnimalsFolder:GetChildren()) do
69 if model:IsA("Model") then
70 local hrp = model:FindFirstChild("HumanoidRootPart")
71 if hrp then
72 processTarget(hrp, hrp.Position)
73 end
74 end
75 end
76 end
77
78 if CONFIG.NPCs and NPCsFolder then
79 for _, descendant in ipairs(NPCsFolder:GetDescendants()) do
80 if descendant:IsA("Model") then
81 local hrp = descendant:FindFirstChild("HumanoidRootPart")
82 if hrp then
83 processTarget(hrp, hrp.Position)
84 end
85 end
86 end
87 end
88
89 if closestDist > 1000 then
90 return nil
91 end
92 return targetPos
93end
94
95local ProjectileHandler = require(ReplicatedStorage.SharedModules.World.ProjectileHandler)
96local oldGetSpread = ProjectileHandler.GetProjectileSpread
97
98ProjectileHandler.GetProjectileSpread = function(self, projectileType, projectileParams, info, numProjectiles)
99 if info and info.origin then
100 local targetPos = getTargetPosition(info.origin)
101 if targetPos then
102 local newDir = (targetPos - info.origin).Unit
103 info.direction = newDir
104 end
105 end
106 return oldGetSpread(self, projectileType, projectileParams, info, numProjectiles)
107end
108
109local oldInit = ProjectileHandler.InitProjectiles
110ProjectileHandler.InitProjectiles = function(self, projectileType, projectileParams, info, callback)
111 if info and info.origin then
112 local targetPos = getTargetPosition(info.origin)
113 if targetPos then
114 local newDir = (targetPos - info.origin).Unit
115 info.direction = newDir
116 end
117 end
118 return oldInit(self, projectileType, projectileParams, info, callback)
119end