I have a bazooka i’m making and I have the rockets on a collision group set to false, so I assume they shouldn’t invoke a .touched event and even with that i have a check on the touched even as well with an ignore list with the rockets in them, basically what i’m trying to achieve is to have it only fire/explode the rocket when it touches someone that isn’t the creator and or another rocket.
creator = game.Workspace:FindFirstChild(p.Name)
for i,v in pairs(creator:GetChildren()) do
if v:IsA("BasePart") then
ps:SetPartCollisionGroup(v,"creator")
end
end
ps:SetPartCollisionGroup(rocket,"rockets")
ps:CollisionGroupSetCollidable("creator","rockets",false)
ps:CollisionGroupSetCollidable("rockets","rockets",false)
rocket.Touched:Connect(function(h)
if rocket and h then
if ignorelist[string.lower(h.Name)] then
return
end
if h.Parent.Name == p.Name or h.Parent.Parent.Name == p.Name then
return
end
local explosion = Instance.new('Explosion')
explosion.BlastPressure = 0
explosion.BlastRadius = 1
explosion.ExplosionType = Enum.ExplosionType.NoCraters
explosion.Position = rocket.Position
explosion.Parent = game.Workspace
explosion.Hit:connect(function(hit)
if hit then
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent.Name == p.Name then
return
else
addtags(hit.Parent.Humanoid)
end
end
if hit.Parent.Parent:FindFirstChild("Humanoid") then
if p.Parent.Parent.Name == p.Name then
return
else
addtags(hit.Parent.Parent.Humanoid)
end
end
end
end)
end
rocket:Destroy()
end)