local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local CollectionService = game:GetService("CollectionService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local LocalPlayer = Players.LocalPlayer local Camera = workspace.CurrentCamera local Utility, GameplayUtility, Gun, FighterController pcall(function() Utility = require(ReplicatedStorage.Modules.Utility) GameplayUtility = require(ReplicatedStorage.Modules.GameplayUtility) Gun = require(LocalPlayer.PlayerScripts.Modules.ItemTypes.Gun) FighterController = require(LocalPlayer.PlayerScripts.Controllers.FighterController) end) if Gun and Gun.IsFullyAiming then Gun.IsFullyAiming = function() return true end end local HitboxNames = {"HitboxHead", "HitboxHeadSmall", "PhysicalHitboxHead", "Head"} local cache_1, cache_2 = 0, nil local function Closest() if os.clock() - cache_1 < 0.05 then return cache_2 end cache_1 = os.clock() cache_2 = nil local Mouse = UserInputService:GetMouseLocation() local Best, BestScreen, BestWorld = nil, math.huge, math.huge for _, Entity in CollectionService:GetTagged("Entity") do if Entity == LocalPlayer.Character then continue end local Player = Players:GetPlayerFromCharacter(Entity) if Player then local MyTeam, scary = LocalPlayer.Team, Player.Team if MyTeam and scary and MyTeam == scary then continue end local Humanoid = Entity:FindFirstChildOfClass("Humanoid") if not Humanoid or Humanoid.Health <= 0 then continue end end for _, Name in HitboxNames do local Part = Entity:FindFirstChild(Name, true) if not Part or not Part:IsA("BasePart") then continue end local ScreenPoint, OnScreen = Camera:WorldToViewportPoint(Part.Position) if not OnScreen then continue end local ScreenDistance = (Vector2.new(ScreenPoint.X, ScreenPoint.Y) - Mouse).Magnitude local WorldDistance = (Part.Position - Camera.CFrame.Position).Magnitude if ScreenDistance + 15 < BestScreen or (math.abs(ScreenDistance - BestScreen) <= 15 and WorldDistance < BestWorld) then Best, BestScreen, BestWorld = Part, ScreenDistance, WorldDistance end break end end cache_2 = Best return Best end local function EquippedInfo() local Fighter = FighterController and FighterController.LocalFighter local Item = Fighter and Fighter.EquippedItem return Item and Item.Info end local function Grappler() local Info = EquippedInfo() return Info ~= nil and Info.Name == "Grappler" end local function BulletDrop(Distance) local Info = EquippedInfo() local Speed = Info and Info.ProjectileSpeed local Gravity = Info and Info.ProjectileGravity if Speed and Speed > 0 and Gravity and Gravity > 0 then local Time = Distance / Speed return Gravity * workspace.Gravity * 0.5 * Time * Time end return 0 end local HitParams = RaycastParams.new() HitParams.FilterType = Enum.RaycastFilterType.Include if GameplayUtility then local OldGetEntitiesFromRaycast = GameplayUtility.GetEntitiesFromRaycast GameplayUtility.GetEntitiesFromRaycast = function(Self, EnvID, Params, Origin, Direction, MaxDistance, ...) local Target = not Grappler() and Closest() if Target then Direction = (Target.Position - Origin).Unit local Distance = (Target.Position - Origin).Magnitude if Distance > MaxDistance then MaxDistance = Distance + 5 end end return OldGetEntitiesFromRaycast(Self, EnvID, Params, Origin, Direction, MaxDistance, ...) end end local UseItem = ReplicatedStorage.Remotes.Replication.Fighter.UseItem local OldFireServer OldFireServer = hookfunction(UseItem.FireServer, function(Self, ObjID, EnumValue, CamData, Extra) local Inner = type(CamData) == "table" and CamData[utf8.char(1)] if LocalPlayer.Character and Inner and typeof(Inner[utf8.char(2)]) == "Instance" and Inner[utf8.char(0)] ~= nil and not Grappler() then local Target = Closest() if Target then local Origin = Camera.CFrame.Position HitParams.FilterDescendantsInstances = {Target} local Result = workspace:Raycast(Origin, Target.Position - Origin, HitParams) local HitPosition = Result and Result.Position or Target.Position local Aim = CFrame.lookAt(Origin, Target.Position + Vector3.new(0, BulletDrop((Target.Position - Origin).Magnitude), 0)) CamData = { [utf8.char(1)] = { [utf8.char(0)] = Utility:EncodeCFrame(Aim), [utf8.char(1)] = Utility:EncodeCFrame(Aim), [utf8.char(2)] = Target, [utf8.char(3)] = Utility:EncodeCFrame(Target.CFrame:ToObjectSpace(CFrame.new(HitPosition))), } } end end return OldFireServer(Self, ObjID, EnumValue, CamData, Extra) end) warn'!@#$%^&*()'