if game.Workspace.cap.flag == BrickColor.new("Bright blue")then game.Workspace.door.Transparency = 1 game.Workspace.door.CanCollide = true else game.Workspace.door.Transparency = 0 game.Workspace.door.CanCollide = false end
-- i have no idea why it's not working i need help trying to get the door to be invisible and CanCollide = true when the flag is Bright blue
if game.Workspace.cap.flag == BrickColor.new("Bright blue") then game.Workspace.door.Transparency = 1 game.Workspace.door.CanCollide = true else game.Workspace.door.Transparency = 0 game.Workspace.door.CanCollide = false end
Just to make your script more organized.
First off, game.Workspace.cap.flag
isn't a valid property for BrickColor. I don't know your doors children, so if the flag is named flag
under cap
then you write the BrickColor property, like this.
game.Workspace.cap.flag.BrickColor
Without the BrickColor property, you're asking the script if the flag is equal to a BrickColor of bright blue, or has a value of that, which doesn't make sense. Here might be a working script.
if game.Workspace.cap.flag.BrickColor == BrickColor.new("Bright blue") then game.Workspace.door.Transparency = 1 game.Workspace.door.CanCollide = true else if game.Workspace.cap.flag.BrickColor ~= BrickColor.new("Bright blue") then game.Workspace.door.Transparency = 0 game.Workspace.door.CanCollide = false end
This script might not work because of the ends. I just made this up. Also, maybe if this script works, putting this script in a while loop, a loop that goes forever, may be good because it's always checking for the contents of the flag color and stuff.