I made a script where the part explodes when it collides with anything. How do I make so it only explodes when touching the objects, not with players?
Here's my script;
function onTouched(hit)
local e = Instance.new("Explosion")
e.BlastRadius = 15
e.BlastPressure = 1000
e.Parent = game.Workspace
e.Position = script.Parent.Position
end
script.Parent.Touched:connect(onTouched)

4 comments
check that hit.Parent does not contain a humanoid
What do you mean by that?
Check if hit.Parent has 'Humanoid' in an if statement at the beginning of the function.
if humanoid then end if not humanoid then local e...