I made a script for a bullet whenever it touches an object it deletes itself and is replaced by a black part stuck inside whatever the bullet hit only problem is the part goes higher than where the bullet hit on the wall
**Here's my script : **
script.Parent.Touched:connect(function(hit)
if hit.Parent.Humanoid then
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health -10
end
end)
--beyond this point is an error be careful!
script.Parent.Touched:connect(function(hit)
local p = Instance.new("Part", workspace)
p.Position = script.Parent.Position
p.FormFactor = "Custom"
p.Size = Vector3.new(0.2, 0.2, 0.2)
p.Color = Color3.new(0, 0, 0)
p.CFrame = p.CFrame - Vector3.new(.2, -4, .2)
p.Anchored = true
script.Parent:Destroy()
end)
