The parts are not changing color

So I am trying to make multiple parts change to a different color but it didn’t work and here is the script and there are no errors.


local checkpointchildren = workspace.Checkpoints:GetChildren()
script.Parent.MouseButton1Click:connect(function()
    checkpointchildren.Color = Color3.fromRGB(83, 167, 83)
end)

checkpointchildren is an array containing all the checkpoints. You are supposed to change the color of each one using a loop.

for i, checkpoint in pairs(checkpointchildren) do
	checkpoint.Color = Color3.fromRGB(83, 167, 83)
end 

I suggest you check Introduction to Scripting | Roblox Creator Documentation and Tables | Roblox Creator Documentation

1 Like

You need to iterate through every basepart. Right now you are trying to cast a color propery on an array, which does not have the color property.