The Damage Display script-
local isUsing = false local tool = script.Parent.Parent local Blade1 = script.Parent.Parent.Union local Blade2 = script.Parent.Parent.Union2 local Blades = Blade1 or Blade2 local DamageDis = script.Parent.Parent.Instances.DamageDisplay:Clone() local Damage = script.Parent.Parent.Values.Damage local DamageText = script.Parent.Parent.Instances.DamageDisplay.Damage:Clone() local CanDamage = script.Parent.Parent.Values.CanDamage local Attachment = Instance.new("Attachment") tool.Activated:Connect(function() isUsing = true wait(2) isUsing = false end) Blades.Touched:Connect(function(hit) local HumanoidRoot = hit.Parent:FindFirstChild("HumanoidRootPart") if isUsing and HumanoidRoot and CanDamage.Value == true then Attachment.Parent = HumanoidRoot DamageDis.Parent = Attachment DamageText.Parent = DamageDis DamageText.Text = tostring(Damage.Value) DamageDis.Enabled = true wait(2) DamageDis:Destroy() DamageText:Destroy() Attachment:Destroy() end end)
And the error is - The Parent property of Attachment is locked, current parent: NULL, new parent HumanoidRootPart
You only created one instance of an Attachment object. On line 29, you destroy that object the first time .Touched fires, and therefore there are no more attachments to destroy (hence the NULL error). To fix this, create a new attachment whenever the .Touched event fires.
local isUsing = false local tool = script.Parent.Parent local Blade1 = script.Parent.Parent.Union local Blade2 = script.Parent.Parent.Union2 local Blades = Blade1 or Blade2 local DamageDis = script.Parent.Parent.Instances.DamageDisplay:Clone() local Damage = script.Parent.Parent.Values.Damage local DamageText = script.Parent.Parent.Instances.DamageDisplay.Damage:Clone() local CanDamage = script.Parent.Parent.Values.CanDamage tool.Activated:Connect(function() isUsing = true wait(2) isUsing = false end) Blades.Touched:Connect(function(hit) local HumanoidRoot = hit.Parent:FindFirstChild("HumanoidRootPart") if isUsing and HumanoidRoot and CanDamage.Value == true then local Attachment = Instance.new("Attachment") Attachment.Parent = HumanoidRoot DamageDis.Parent = Attachment DamageText.Parent = DamageDis DamageText.Text = tostring(Damage.Value) DamageDis.Enabled = true wait(2) DamageDis:Destroy() DamageText:Destroy() Attachment:Destroy() end end)