I have a question on how to change the color of a part while my door is open and the turn back to normal when the door closes.
This is what I already have to open/close the door and it works but I want to add in a line that changes the color of a part names:"indicatorlight" to turn green when the door is open and red when the door is closed.
script.Parent.Touched:Connect(function(hit)
if hit.Parent.Name == "KeyCard" then
game.Workspace.Corridor.KeyCardDoor.CanCollide = false
game.Workspace.Corridor.KeyCardDoor.Transparency = 1
wait(2.5)
game.Workspace.Corridor.KeyCardDoor.CanCollide = true
game.Workspace.Corridor.KeyCardDoor.Transparency = 0
end
end)
Please help.

4 comments
I changed the script but now my door opens stays open and the color doesnt change .
Are there any errors in the output?
If indicatorlight is in the door model then use “game.Workspace.Corridor.KeyCardDoor.indicatorlight.Color = BrickColor.Green() “
^ Forgot to add that part. Thanks