I want to achieve a fully functional AI system, meaning it moves from 1 place to another, and not hop across the map. And a Jump scare when you die.
My AI system is extremely quick even though I set the AI pretty low for the most part. But, when the animatronic gets to my door, it doesn’t fire the jump scare.
Another issue I had, was when the animatronic would stop right before he was at the door.
I’ve tried adding waits, attempting to rework the movement opportunity system, I’ve tried. I did look for solutions, but nothing was that helpful.
Hey! I wanted help with a AI system I was making. It’s based on FNaF’s AI system. Only problem. It won’t work. I just want to find out what the problem is, so I can fix it.
Heres the script:
–script start
ServerStorage = game.ServerStorage
local player = game.Players.LocalPlayer
Seconde = wait()
game.Workspace[“Freddy’s Laugh”]:Play()
World = game.Workspace
local Place = Instance.new(“IntValue”)
Place.Value = 1
local model = game.Workspace.Bacon1
Place.Changed:Connect(function()
if Place.Value == 1 then
model:SetPrimaryPartCFrame(game.ServerStorage["Bacon1.5"].PrimaryPart.CFrame)
end
if Place.Value == 2 then
model:SetPrimaryPartCFrame(game.ServerStorage.Bacon2.PrimaryPart.CFrame)
end
if Place.Value == 3 then
model:SetPrimaryPartCFrame(game.ServerStorage.Bacon3.PrimaryPart.CFrame)
end
if Place.Value == 4 then
model:SetPrimaryPartCFrame(game.ServerStorage.Bacon4.PrimaryPart.CFrame)
--Moving to places
end
if Place.Value == 5 then
workspace.Everythingno:FireAllClients()
workspace.Jumpscare:FireAllClients()
--Jumpscare is supposed to fire here.
end
end)
while true do
local AI = math.random(1,5)
if Place.Value >= 6 then
Place.Value = 5
end
wait(6)
local second = math.random(1,20)
if second <= AI then
wait(6)
print("Movement successful.")
for i = 1, 1050 do
wait(0.01)
end
Place.Value = Place.Value + math.random(-1,1)
else
wait(5)
print("Movement failed.")
end
end