
Key Required

local LPlayer = game:GetService("Players").LocalPlayer
local remote = game:GetService("ReplicatedStorage").BulletFireSystem.FireBullet
local LMouse = LPlayer:GetMouse()
local Camera = game:GetService("Workspace").CurrentCamera
local fovAmount = 200
local teamCheck = false
local fovCircle = Drawing.new("Circle")
fovCircle.Radius = fovAmount
fovCircle.Visible = true
fovCircle.Color = Color3.fromRGB(212, 34, 255)
fovCircle.Thickness = 1
fovCircle.NumSides = 12
fovCircle.Position = Vector2.new(0, 0)
local function UpdateFovCircle()
local mousePos = Camera.WorldToViewportPoint(Camera, LMouse.Hit.Position)
fovCircle.Radius = fovAmount
fovCircle.Position = Vector2.new(mousePos.X, mousePos.Y)
end
local function IsInFov(position)
local mousePos = Vector2.new(LMouse.X, LMouse.Y)
local screenPosition, isVisible = Camera:WorldToViewportPoint(position)
local distanceToMouse = (mousePos - Vector2.new(screenPosition.X, screenPosition.Y)).Magnitude
return isVisible and distanceToMouse <= fovAmount
end
local function GetClosestPlayer()
local ClosestDistance, ClosestPlayer = math.huge, nil
for _, Player in game:GetService("Players"):GetPlayers() do
if Player ~= LPlayer then
local Character = Player.Character
if Character and Character:FindFirstChild("Humanoid") and Character.Humanoid.Health > 0 then
local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
if
HumanoidRootPart
and IsInFov(HumanoidRootPart.Position)
and (not teamCheck or Player.Team ~= LPlayer.Team)
then
local screenPosition, isVisible = Camera:WorldToViewportPoint(HumanoidRootPart.Position)
if isVisible then
local distanceToMouse = (LMouse.X - screenPosition.X) ^ 2
+ (LMouse.Y - screenPosition.Y) ^ 2
if distanceToMouse < ClosestDistance then
ClosestPlayer = Player
ClosestDistance = distanceToMouse
end
end
end
end
end
end
return ClosestPlayer
end
game:GetService("RunService").RenderStepped:Connect(UpdateFovCircle)
local oldNamecall
oldNamecall = hookmetamethod(remote, "__namecall", newcclosure(function(self, ...)
if typeof(self) == "Instance" then
local method = getnamecallmethod()
if method and (method == "FireServer" and self == remote) then
local target = GetClosestPlayer()
local targetchar = target and target.Character or nil
local targetHumanoidRootPart = targetchar and targetchar:FindFirstChild("HumanoidRootPart") or nil
local targetHead = targetchar and targetchar:FindFirstChild("Head") or nil
if targetHumanoidRootPart and targetHead then
local remArgs = {...}
remArgs[2] = targetHead
remArgs[3] = targetHead.Position
setnamecallmethod(method)
return oldNamecall(self, unpack(remArgs))
else
setnamecallmethod(method)
end
end
end
return oldNamecall(self, ...)
end))



it works well when it wants to work, however it feels very inconsistent. feels like the fov circle isnt accurate and the actual fov is much smaller. and it sometimes just fails to hit the target, am not talking about going 200 mph at like 3k studs, no like sometimes it just doesnt work even when point blank. Still very good when it wants to work. just a question, would this be able to be implemented into vehicles. not talking about just machine guns but like have the main gun on a tank be homing or some ****. just snipe helis out of the sky
Can you create wallbang script but for scp roleplaying