newbie here, im trying to make a sliding door but i don't know what's wrong.
gate = script.Parent.Parent.Gate active = script.Parent.Parent.Bool condition = script.Parent.Parent.Condition function onClick() if active.Value == true then if condition.Value == false then active.Value = false print("opening...") for i = 1, 28 do gate.Position = gate.Position + Vector3.new(0.5, 0, 0) wait(.1) end condition.Value = true active.Value = true else active.Value = false print("closing...") for i = 1, 28 do gate.Position = gate.Position - Vector3.new(0.5, 0, 0) wait(.1) end condition.Value = false active.Value = true end end end script.Parent.ClickDetector.MouseClick:connect(onClick()
This might not be helpful, but try putting prints at some places, if it doesnt print thats where its wrong