Hello! I have recently made my own morph for a Big Daddy from Bioshock, I am now developing a drill to go along with it, that is supposed to damage humanoids and spawn blood. It damages the Humanoid but does not spawn the Blood. It is in a tool and I can hold it, I also have several parts named "Part", one Part named "Drill", one named "Tip" which is were the blood comes out, and one part named "Handle" which is were the script is located. Here is what I have so far: Note nothing comes up in the Output.
function onTouched(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
if (humanoid ~= nil) then
humanoid.Health = humanoid.Health - 30
end
P1 = Instance.new("Part")
P1.Position = script.Parent.Parent.Tip.Position
P1.TopSurface = "Smooth"
P1.BottomSurface = "Smooth"
P1.BrickColor = BrickColor.new("Bright red")
P1.FormFactor = 2
P1.Size = Vector3.new(1,0.4,1)
P1.CanCollide = true
P1.Anchored = false
P1.Transparency = 0
P2 = Instance.new("Part")
P2.Position = script.Parent.Parent.Tip.Position
P2.TopSurface = "Smooth"
P2.BottomSurface = "Smooth"
P2.BrickColor = BrickColor.new("Bright red")
P2.FormFactor = 2
P2.Size = Vector3.new(1,0.4,1)
P2.CanCollide = true
P2.Anchored = false
P2.Transparency = 0
end
connection = script.Parent.Touched:connect(onTouched)

2 comments
Thanks! that worked!
Or when using instance.new('Part', parent) parent becomes the new part's parent.