hello. i made this code to make sure something goes not right or left twice after each other. how do i make it go twice each other minimum before going lecft or right again? (no, i do not want to instantly sppawn the rooms.)
i want to stora a variable if possible or something…
if GoneLeft and not GoneRight then
local Chance = math.random(1,2)
if Chance == 1 then
GoneLeft = false
GoneRight = true
SELECTED_FOLDER = Selected_Roomcategory_Folder.RIGHT
warn("right")
else
SELECTED_FOLDER = Selected_Roomcategory_Folder.STRAIGHT
end
elseif GoneRight and not GoneLeft then
local Chance = math.random(1,2)
if Chance == 1 then
GoneLeft = true
GoneRight = false
SELECTED_FOLDER = Selected_Roomcategory_Folder.LEFT
warn("left")
else
SELECTED_FOLDER = Selected_Roomcategory_Folder.STRAIGHT
end
end