part = Instance.new("Part")
part.Parent = game.Workspace
Instance.new("Part")
part.Anchored = false
part.BrickColor = BrickColor.new("Dark green")
part.Position = Vector3.new(0,100,0)
part.Size = Vector3.new(0.5,3,0.5)
local part = script.Parent
local function onPartTouch(otherPart)
local partParent = otherPart.Parent
local humanoid = partParent:FindFirstChildWhichIsA("Humanoid")
if humanoid then
humanoid.Health = 0
end
end
part.Touched:Connect(onPartTouch)
If I paste everythin from local part = script.Parent and so on into a normal part it will work but won't work with Instance.new? Is it possible to fix that?

1 comment
It works, thank you!