
KeylessUniversal

-- Made by samet.exe (discord)
local ReplicatedFirst = game:GetService("ReplicatedFirst");
local ScriptContext = game:GetService("ScriptContext");
local Players = game:GetService("Players");
local Workspace = game:GetService("Workspace");
local UserInputService = game:GetService("UserInputService");
local Framework = require(ReplicatedFirst:FindFirstChild("Framework"));
local Classes, Libraries = Framework.Classes, Framework.Libraries;
local LocalPlayer = Classes.Players.get();
local Camera = Workspace.CurrentCamera;
local Bullets = Libraries.Bullets;
local OldFire;
task.spawn(function() -- if your executor does not have "getconnections" you can leave this part out
local Success, Error = pcall(function()
for _, Connection in getconnections(ScriptContext.Error) do
Connection:Disconnect(); -- this is incase your game crashes on a error
end;
end);
if not (Success) then
warn(Error);
end;
end);
local GetClosestPlayer = function(Radius: number)
local ClosestPlayer, ClosestRoot;
local ClosestDistance = Radius or math.huge;
local AllPlayers = Workspace:FindFirstChild("Characters");
for _, Value in AllPlayers:GetChildren() do
if Value == LocalPlayer.Character then
continue end;
local HumanoidRootPart = Value:FindFirstChild('HumanoidRootPart');
local Humanoid = Value:FindFirstChild('Humanoid');
if not HumanoidRootPart or not Humanoid then
continue end;
local Position, IsVisible = Camera:WorldToViewportPoint(HumanoidRootPart.Position);
local Distance = (Vector2.new(Position.X, Position.Y) - UserInputService:GetMouseLocation()).Magnitude;
if not IsVisible then
continue end;
if Distance < ClosestDistance then
ClosestDistance = Distance;
ClosestRoot = HumanoidRootPart;
ClosestPlayer = Value;
end;
end;
return ClosestPlayer, ClosestRoot;
end;
OldFire = hookfunction(Bullets.Fire, function(self, ...)
local Target, Root = GetClosestPlayer();
local Args = {...};
if Target and Root then
-- Args[5] = Direction
-- Args[4] = Origin
Args[5] = (Target.Head.Position - Root.Position).Unit;
end;
return OldFire(self, ...);
end);



doesnt work on wave