I'm trying to make this shield that defends against bullets and paintballs, but it isn't working!
function onTouched(part)
if part.Name == "Bullet" or "Paintball" then
Shield = Instance.New("Part")
Shield.Size = Vector3.new(.2,.2,.2)
Shield.CanCollide = false
Shield.Parent = game.Workspace
Shield.BrickColor = ("Really red")
Shield.Position = script.Parent
local mesher = Instance.new("BlockMesh")
mesher.Parent = Shield
mesher.Scale = Vector3.new(0.2, 0.2, (script.Parent.Position - onTouched(part).Position).magnitude)
explosion = Instance.new("Explosion")
explosion.Parent = game.Workspace
explosion.Position = part
wait(1)
part:remove()
end
end

1 comment
Please specify how this isn't working, we don't know what you want this to do and what it's doing instead.