-- ModuleScript WeaponAimRay (via decompile) local CollectionService_upv_1 = game:GetService("CollectionService") local v1 = game:GetService("ReplicatedStorage") local Workspace_upv_1 = game:GetService("Workspace") local v2 = script:FindFirstAncestor("App") local AimAssist_upv_1 = require(v2.Modules.Weapon.AimAssist) local VehicleConstants_upv_1 = require(v1.App.Config.VehicleConstants) v1 = require(v2.Types.WeaponRuntimeState) local u1 = RaycastParams.new() u1.FilterType = Enum.RaycastFilterType.Exclude u1.RespectCanCollide = false u1.IgnoreWater = true v1 = {} local u2 = nil local function refreshAimFilter() --[[ name: refreshAimFilter line: 20 upvalues: CollectionService_upv_1 (copy, index: 1) VehicleConstants_upv_1 (copy, index: 2) u2 (ref, index: 3) u1 (copy, index: 4) ]] local v3 = CollectionService_upv_1:GetTagged(VehicleConstants_upv_1.PROXY_TAG) if u2 then table.insert(v3, u2) end u1.FilterDescendantsInstances = v3 end CollectionService_upv_1:GetInstanceAddedSignal(VehicleConstants_upv_1.PROXY_TAG):Connect(refreshAimFilter) CollectionService_upv_1:GetInstanceRemovedSignal(VehicleConstants_upv_1.PROXY_TAG):Connect(refreshAimFilter) function v1.bindCharacter(a1) --[[ name: bindCharacter line: 31 upvalues: u2 (ref, index: 1) CollectionService_upv_1 (copy, index: 2) VehicleConstants_upv_1 (copy, index: 3) u1 (copy, index: 4) ]] u2 = a1 local v4 = CollectionService_upv_1:GetTagged(VehicleConstants_upv_1.PROXY_TAG) if u2 then table.insert(v4, u2) end u1.FilterDescendantsInstances = v4 end local function isFoliage(a1) --[[ name: isFoliage line: 36 ]] local v5 = string.lower(a1.Name) if not (string.find(v5, "leaf", 1, true)) and not (string.find(v5, "foliage", 1, true)) and not (string.find(v5, "canopy", 1, true)) then local v6 = a1:FindFirstAncestorOfClass("Accessory") if not v6 then return false end local Parent_1 = v6.Parent local v7 = true if Parent_1 ~= nil then v7 = Parent_1:FindFirstChildOfClass("Humanoid") == nil end return v7 end return true end function v1.direction(a1) --[[ name: direction line: 49 upvalues: Workspace_upv_1 (copy, index: 1) AimAssist_upv_1 (copy, index: 2) u1 (copy, index: 3) isFoliage (copy, index: 4) ]] local CurrentCamera_1 = Workspace_upv_1.CurrentCamera if not CurrentCamera_1 then return a1.head.CFrame.LookVector end local v8 = CurrentCamera_1.ViewportSize * 0.5 local v9 = CurrentCamera_1:ViewportPointToRay(v8.X, v8.Y) local Origin_1 = v9.Origin local v10 = AimAssist_upv_1.pull(Origin_1, v9.Direction.Unit) v9 = table.clone(u1.FilterDescendantsInstances) local v11 = RaycastParams.new() v11.FilterType = Enum.RaycastFilterType.Exclude v11.RespectCanCollide = false v11.IgnoreWater = true v11.FilterDescendantsInstances = v9 local v12 = a1.config.maxRange local v13 = nil local v14, v15 = nil, nil v14 = Origin_1 for _ = 1, 8 do if v12 <= 0 then break end v15 = Workspace_upv_1:Raycast(v14, v10 * v12, v11) if not (v15) then v13 = v15 break end local v16 = isFoliage(v15.Instance) if v16 then table.insert(v9, v15.Instance) v11.FilterDescendantsInstances = v9 local v17 = v15.Position + v10 * 0.05 v12, v14, v13 = v12 - ((v15.Position - v14).Magnitude + 0.05), v17, nil continue else v13 = v15 break end end if v13 then v12 = v13.Position else v12 = Origin_1 + v10 * a1.config.maxRange end local v18 = v12 - a1.head.Position if v18.Magnitude < 0.001 then return v10 end return v18.Unit end return v1