Before i begin, I will warn you all that i do not know very much lua, so please forgive me if my issue is something stupidly obvious.
The basic idea of my script is to change the material of 5 bricks according to the NumberValue (Named DefconLevel), Except when 'DefconLevel.Value' Is changed, None of the materials change. (I only have the print in defcon 3 because that was the one i was switching to for testing.)
print("Defcon script started")
defcon = script.Parent.Defconlevel.Value
p = script.Parent
while true do
if defcon == 1 then
p.defcon1.Material = "Neon"
p.defcon2.Material = "Plastic"
p.defcon3.Material = "Plastic"
p.defcon4.Material = "Plastic"
p.defcon5.Material = "Plastic"
elseif defcon == 2 then
p.defcon1.Material = "Plastic"
p.defcon2.Material = "Neon"
p.defcon3.Material = "Plastic"
p.defcon4.Material = "Plastic"
p.defcon5.Material = "Plastic"
elseif defcon == 3 then
p.defcon1.Material = "Plastic"
p.defcon2.Material = "Plastic"
p.defcon3.Material = "Neon"
p.defcon4.Material = "Plastic"
p.defcon5.Material = "Plastic"
print("defcon level is now 3!")
elseif defcon == 4 then
p.defcon1.Material = "Plastic"
p.defcon2.Material = "Plastic"
p.defcon3.Material = "Plastic"
p.defcon4.Material = "Neon"
p.defcon5.Material = "Plastic"
elseif defcon == 5 then
p.defcon1.Material = "Plastic"
p.defcon2.Material = "Plastic"
p.defcon3.Material = "Plastic"
p.defcon4.Material = "Plastic"
p.defcon5.Material = "Neon"
end
wait(0.1)
warn ("checked")
end

2 comments
Material takes an Enum not a string
Also, you should be using local variables