Ohhh, I didn’t realize that you had different difficulties.
The one about pairs
? It shouldn’t change how the Instances are accessed and what v
is, it should remain exactly the same. The only thing that can explain v
changing is that you’ve changed the hours
variable.
I’m having trouble understand exactly what you want the code to do. Do each of these hours have different requirements and you’ve just separated them into folders? I wouldn’t really recommend that because then you won’t be able to easily find all the hours. Instead, you could give them a Difficulty
attribute and then configure how likely each of the difficulties are to be enabled in some sort of “configuration” object or ModuleScript
.
Then, you can change the code to initially a dice to select the difficultly, and then go through each of the scenarios and find the first one that meets all the requirements (i.e. has the same difficulty, + other variables like maybe an hour can only trigger in Halloween).
But another possibility has come across my head that maybe you want some hours of the day to be difficult (eg: midnight has “hard” mode) and there’s a random chance for each of the scenarios in that difficultly group to be chosen? As I said before, sometimes just seeing the related code and instance hierarchy isn’t enough - you should include what the code should be doing as well, otherwise it can be difficult to give helpful or useful advice.