forked from zzerexx/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAimbloxSilentAim.lua
More file actions
54 lines (52 loc) · 1.88 KB
/
AimbloxSilentAim.lua
File metadata and controls
54 lines (52 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
-- DO NOT USE!! YOU WILL GET BANNED!
if game.PlaceId ~= 6808489605 then
return
end
local players = game:GetService("Players")
local player = players.LocalPlayer
function ClosestPlayer()
local plr
local closest = math.huge
if player.Team == nil then
for i,v in next, players:GetPlayers() do
if v ~= player and v.Character and v.Character.Humanoid.Health > 0 then
local mag = (player.Character.HumanoidRootPart.Position - v.Character.HumanoidRootPart.Position).Magnitude
if mag < closest then
closest = mag
plr = v
end
end
end
else
for i,v in next, players:GetPlayers() do
if v ~= player and v.Team ~= player.Team and v.Character and v.Character.Humanoid.Health > 0 then
local mag = (player.Character.HumanoidRootPart.Position - v.Character.HumanoidRootPart.Position).Magnitude
if mag < closest then
closest = mag
plr = v
end
end
end
end
return plr
end
local mt = getrawmetatable(game)
local oldmt = mt.__index
local oldnc = mt.__namecall
setreadonly(mt,false)
mt.__namecall = newcclosure(function(self,...)
local args, method = {...}, getnamecallmethod()
if method == "FireServer" and args[1] == "ShootSound" then
local plr = ClosestPlayer()
game:GetService("ReplicatedStorage").Remotes.GunShot:FireServer(
plr,
workspace.CurrentCamera:FindFirstChildOfClass("Model").Name,
require(game:GetService("ReplicatedFirst"):WaitForChild("Shared"):WaitForChild("RemoteUtils")).PackVector(plr.Character.Head.Position),
plr.Character.Head,
"Default"
)
return oldnc(self,unpack(args))
end
return oldnc(self,...)
end)
setreadonly(mt,true)