I want to make a door that for it to open needs plates to be activated beforehand but it doesn't work as intended this is the script inside the model for the door to move
local val = script.Parent.Values local dis = 150 local moved = false local door = script.Parent.Door if val.Value1.Value == "false" and val.Value2.Value == "false" and val.Value3.Value == "false" and val.Value4.Value == "false" and val.Value5.Value == "false" and val.Value6.Value == "false" and val.Value7.Value == "false" and val.Value8.Value == "false" and val.Value9.Value == "false" then if moved == false then moved = true for i=0, dis do door.CFrame = door.CFrame + Vector3.new(0,0,0.2) wait() end end elseif moved == true then moved = false for i=0, dis do door.CFrame = door.CFrame + Vector3.new(0,0,-0.2) end end
and this is the script inside the plates:
local touched = false script.Parent.Touched:connect(function(hit) if touched == false then touched = true if script.Parent.Parent.Values.Value1.Value == "false" then script.Parent.BrickColor = BrickColor.new(302) script.Parent.Parent.Values.Value1.Value = "true" elseif script.Parent.Parent.Values.Value1.Value == "true" then script.Parent.BrickColor = BrickColor.new(194) script.Parent.Parent.Values.Value1.Value = "false" end wait(1) touched = false end end)
I'm not sure where the problem lies but I believe it has to do with the first script checking only once if the conditions are met?