local filterTable = {Character}
local castParams = RaycastParams.new()
castParams.FilterType = Enum.RaycastFilterType.Exclude
castParams.FilterDescendantsInstances = filterTable
local Settings = {
MaxLifeTime = 10,
CacheSize = 10,
CacheGrowthSize = 0,
Gravity = Vector3.new(0, -15, 0),
RaycastParam = castParams,
OnCastHit = function(self, hitObj, castData, newPosition)
if hitObj.Instance and hitObj.Instance.Parent then
if hitObj.Instance.Parent:IsA("Accesory") then
table.insert(filterTable, hitObj.Instance)
castParams.FilterDescendantsInstances = filterTable
return
else
local hum = hitObj.Instance.Parent:FindFirstChild("Humanoid")
if hum then
local distance = (FirePoint.WorldPosition - newPosition).Magnitude
FireEvent:FireServer(hum, hitObj.Instance.Name, distance)
end
end
end
self:CastTerminate(castData)
end,
}
Hitting the player and everything else works, but accessories are still blocking shots. Please help ! ![]()