A few tips:
1.) while wait() do is the same as while true do wait(). You could also use the heartbeat event from the runservice.
while wait() do
end
while true do
wait()
end
game:GetService("RunService").Heartbeat:connect(function()
end
2.) You can use pairs instead of for i = 1,#..etc.
for i = 1,#game.Players:GetChildren()
end
for _,player in pairs(game.Players:GetChildren()) do
end
3.) You can use the :IsA() to see if it's a part.
if workspace.Part:IsA("Part") then
print("Part's class name is Part")
end
if workspace.Part:IsA("BasePart") then
print("Part could be a wedge, corner wedge, cylinder, Sphere, Regular Part, etc.")
end
With all these tips we can finally fix your problem.
Problem: You have too many ends! You only need 2 for this script. Also, check to see if script.Parent is a BrickColor Value.
parts = script.Parent.Parent:GetChildren()
for _,x in pairs(parts) do
if x:IsA("Part") then
x.BrickColor = script.Parent.Value
end
end
2 comments
Please put in a code block
Hello? I answered this a day ago. You just have 3 ends. You only need 2.