I'm trying to make this script so that when an NPC's health goes below 50 it'll put a shield up, but nothing happens. Filtering Enabled is on.
name="Humanoid"
while true do
wait(1)
if script.Parent.Humanoid.Health<50 then
script.Parent.Torso.Proj.Beam.Enabled = true
script.Parent.Torso.Shield.Script.Disabled = false
script.Parent.Torso.Shield.Transparency = .5
script.Parent.Torso.Shield.CanCollide = true
else
script.Parent.Torso.Proj.Beam.Enabled = false
script.Parent.Torso.Shield.Script.Disabled = true
script.Parent.Torso.Shield.Transparency = 1
script.Parent.Torso.Shield.CanCollide = false
end
end
Thanks if you can help me!

3 comments
Is there a way to make it so the shield doesn't have the humanoid take damage?
Check if the shield is present. If it is, deal less damage/don't deal damage at all.
Alright