Hiya, This script is my best replication of how the FNaF AI system works. I will now explain how to use this in a FNaF fangame you wanna make on scratch. :D Let's start with the list. This list is simply to keep the AI on track, so there's no confusion. You can have as many rooms as you'd like, as the AI will track how long the list is. They can also be named anything, since nothing actually tracks what they are called. Next up is the aggression, RNG and timer system. It's quite simple, actually. The timer can be manipulated to your liking by editing the values. The "set timer to ( )" and "repeat ( )" must be equal, and keep in mind that there are two sets of timer scripts, so edit them both if you want. The RNG and aggression system work together, essentially. When the timer hits zero, the RNG variable will be set to a random number between 1 and 20. The script will then compare this random value to the AI Aggression variable. If the aggression is greater than or equal to the random RNG value, the AI will progress to the next location. On maximum aggression, the AI will always move locations when the timer hits zero. The "Locked" variable can be switched to 1 to cause the AI to automatically fail all RNG comparing. This could be used for cases like Foxy, where if the cameras are up he won't move. Player health will start at one, and will switch to zero when deceased. If you slide the leftdoorclosed variable to one, the AI cannot progress into the office, and resets to either locations 2, 3, or 4, chosen at random. Note that the character should NOT return to the first location, i.e. show stage. If you plan to use this for a FNaF fangame, keep in mind that the aggression level should increase at 2 am and 4 am (if the character is based around Bonnie, Chica, or Foxy.) That's basically the basics. Just click the "Simulate Night" button to begin the AI's progression. If you use this, please credit me and let me know about it so I can check it out. :D Enjoy.
I really hope people notice this. It could be really helpful... ♦ Original FNaF AI by Scott Cawthon ♦ Recreated in Scratch by me, @EnderGamer0727 ♦ I learned how the AI works from this video: https://www.youtube.com/watch?v=ujg0Y5IziiY If anybody can find any bugs, let me know, I guess.