Values = game.Workspace.Values.Value script.Parent.MouseButton1Down:connect(function() if Values.OfficeDoorV.Value == "Closed" and Values.Obscure == "Visible" then game.Workspace.OfficeDoor.DoorFrame.Barrier.Transparency = 0 game.Workspace.OfficeDoor.DoorFrame.Barrier.CanCollide = true Values.OfficeDoorV.Value = "Obscure" print("Obscure") elseif Values.OfficeDoorV.Value == "Open" and Values.Obscure == "Obscure" then game.Workspace.OfficeDoor.DoorFrame.Barrier.Transparency = 1 game.Workspace.OfficeDoor.DoorFrame.Barrier.CanCollide = false print("Visible") end end
The code leaves no errors, and yet does not function. Kind of irritating. If you know anything please point out where I goofed.
I'm going to assume it's because you're checking if an object is equal to a string at line 4 and eleven, and you aren't properly changing the values to reflect the door's status
Values = game.Workspace.Values.Value script.Parent.MouseButton1Down:connect(function() if Values.OfficeDoorV.Value == "Closed" and Values.Obscure.Value == "Visible" then game.Workspace.OfficeDoor.DoorFrame.Barrier.Transparency = 0 game.Workspace.OfficeDoor.DoorFrame.Barrier.CanCollide = true Values.OfficeDoorV.Value = "Open" Values.Obscure.Value ="Obscure" print("Obscure") elseif Values.OfficeDoorV.Value == "Open" and Values.Obscure.Value == "Obscure" then game.Workspace.OfficeDoor.DoorFrame.Barrier.Transparency = 1 game.Workspace.OfficeDoor.DoorFrame.Barrier.CanCollide = false Values.OfficeDoorV.Value = "Closed" Values.Obscure.Value ="Visible" print("Visible") end end