Roblox Pain Silent Aim Script

Roblox Pain Silent Aim Script

Script by Poddy

local FieldOfView = 100
local draw_fov = true
local visible_check = true
-- dont edit here
if draw_fov == true then
local mouse = game:GetService("Players").LocalPlayer:GetMouse()
local fov = Drawing.new("Circle")
fov.Visible = true
fov.Transparency = 0.6
fov.Filled = false
fov.Color = Color3.fromRGB(255,255,255)
fov.Thickness = 2
fov.Radius = (FieldOfView*6)/2
fov.Position = Vector2.new(mouse.X,mouse.Y)
game:GetService("RunService").RenderStepped:Connect(function()
fov.Position = Vector2.new(mouse.X, mouse.Y + (game:GetService("GuiService").GetGuiInset(game:GetService("GuiService")).Y))
end)
end
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local RenderStepped = game:GetService("RunService").RenderStepped
local mouse = LocalPlayer:GetMouse()
local plr = game:GetService("Players").LocalPlayer
local currentCamera = workspace.CurrentCamera
local nearestDistance,player = fov,nil
local function isVisible(thing)
   local camera = game:GetService("Workspace").CurrentCamera
   local charz = game:GetService("Players").LocalPlayer.Character
   local obsc = camera:getPartsObscuringTarget({thing.Position}, {charz, thing.Parent})
   return #obsc == 0
end
local function getNearestPlayer()
   local nearestDistance, player = math.huge, nil
   for i,v in pairs(game:GetService("Players"):GetChildren()) do
       if v ~= game:GetService("Players").LocalPlayer and v.Character ~= nil and game:GetService("Players").LocalPlayer.Character ~= nil and v.Character.Humanoid ~= nil and game:GetService("Players").LocalPlayer.Character.Humanoid ~= nil and v.Character.Humanoid.Health ~= 0 and game:GetService("Players").LocalPlayer.Character.Humanoid.Health ~= 0 then
           if visible_check == true then
           local isit = isVisible(v.Character.Head)
           local vec, visible = currentCamera:WorldToScreenPoint(v.Character.Head.Position)
           local distance = (Vector2.new(vec.X, vec.Y) - Vector2.new(mouse.X, mouse.Y)).magnitude
           if visible and vec.Z > 0 and distance < nearestDistance and isit then --> Check if the player is visible on screen
           nearestDistance = distance
           player = v
           end
           else
           local vec, visible = currentCamera:WorldToScreenPoint(v.Character.Head.Position)
           local distance = (Vector2.new(vec.X, vec.Y) - Vector2.new(mouse.X, mouse.Y)).magnitude
           if visible and vec.Z > 0 and distance < nearestDistance then --> Check if the player is visible on screen
           nearestDistance = distance
           player = v
           end
           end
       end
   end
   return player
end
local ChoosenPlayer;
spawn(function()
   while wait() do
       pcall(function()
       ChoosenPlayer = getNearestPlayer()
       end)
   end
end)
local mt = getrawmetatable(game)
local oldmt = mt.__namecall
setreadonly(mt,false)
mt.__namecall = function(self,...)
local args = {...}
if self.Name == "RemoteFunction" and getnamecallmethod() == "InvokeServer" and ChoosenPlayer ~= nil then
args[1] = ChoosenPlayer.Character.HumanoidRootPart.Position
end
return oldmt(self,unpack(args))
end

Leave a Comment

Your email address will not be published.

%d bloggers like this: