Hello as you can see I have a problem with making my puzzle door so here is the problem:
I made a script that two-button when you click on them they will change their color and when they both changed their colors the door becomes transparent and you can go through it but my script doesn’t work
here is the script:
while true do
if script.Parent.red.BrickColor == "Bright orange" and script.Parent.Blue.BrickColor == "Bright blue" then
print("pp")
script.Parent.Part.Transparency = 1
script.Parent.Part.CanCollide = false
end
end
Yep exactly what I sus out. You must use a remote event and have the color changed on the server side so the server can detect this. If you change the color on a local script then it will only affect the client associated with the script.
while wait() do
if script.Parent.red.BrickColor == BrickColor.new("Bright orange") and script.Parent.Blue.BrickColor == BrickColor.new("Bright blue") then
script.Parent.Part.Transparency = 1
script.Parent.Part.CanCollide = false
end
end
I personally can be staring at an error message and not see it. I would recommend adding an else debug statement:
while true do
if script.Parent.red.BrickColor == "Bright orange" and script.Parent.Blue.BrickColor == "Bright blue" then
print("pp")
script.Parent.Part.Transparency = 1
script.Parent.Part.CanCollide = false
else
print(script.Parent.red.BrickColor)
print(script.Parent.Blue.BrickColor)
end
end