elseif (hit.Parent.Parent.Hull.Name == "FrontArmor") then -- hitparts print("voce danificou o chassi") local HitSound = hit.Parent:findFirstChild("Pen"):Clone() HitSound.Parent = hit HitSound:Play() hit.Parent.Parent:findFirstChild("Damage").Value = hit.Parent.Parent:findFirstChild("Damage").Value - dealingdamage /2 -- makes the damage
Basically this script detects hit on some object and the damage, I set up this line to detect hit in a specific part or it should ... because in test mode this line is ignored, there is nothing in the output related to errors or something like that.
Script Inside the damaging part itself:
script.Parent.Touched:Connect(function(hit) local doesPlrHaveArmor = hit.Parent:FindFirstChild(“FrontArmor”) if hit.Parent:FindFirstChildOfClass(“Humanoid”) and not doesPlrHaveArmor then hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - your damage elseif doesPlrHaveArmor then hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - your damage / 2 end end)