for i,child in pairs(parent:GetChildren()) do if child:IsA('Decal') and child.Name == 'Science' then child.Texture = "http://www.roblox.com/asset/?id=3916138491"-- or Child.Locked = true end end
i am trying to make it when the game starts any decals with the name Science it will change there texture to this http://www.roblox.com/asset/?id=3916138491
Your code is perfect! You just needed to add "script" into the first line, shown here:
for i, child in pairs(parent:GetChildren()) do
to
for i, child in pairs(script.Parent:GetChildren()) do
for i, child in pairs(script.Parent:GetChildren()) do -- Going through the children if child:IsA('Decal') and child.Name == 'Science' then -- Is it a decal? Is it's name "Science"? child.Texture = "http://www.roblox.com/asset/?id=3916138491" -- Let's change it! end end