Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Bonnie = workspace:WaitForChild("Bonnie") --Model w/ a Torso
- local gamevalues = game.ReplicatedStorage.GameValues --Folder
- local hoodStatus = gamevalues.hoodStatus --Boolean
- local oRoom = gamevalues.occupyingRoom --String
- local isO = gamevalues.isOccupied -- Boolean
- local hoodTimer = gamevalues.hoodTimer --NumberValue
- local location = 0
- local Vents = false
- --Heyy, don't mind the skid code.
- --If it errors, it's because you tried to copy and paste this without making an effort so it can work. Don't come crying to me if it's broken.
- --Otherwise, dm scar#8268 on discord or Fifkee on roblox if you have any questions, or if I missed a function that bonnie has.
- --Remade the script, was extremely buggy. It's stable now.
- --NOTE: Bonnie, Chica, Toy Bonnie, Toy Chica, Balloon Boy, and Mangle go in the vents. NOBODY ELSE.
- --holy heck thats a lot of people.
- game:GetService('RunService').RenderStepped:connect(function(step)
- if location < 0 then
- location = 0
- elseif location > 4 then
- location = 4
- end
- if location < 0 and Vents then
- location = 0
- elseif location > 2 and Vents then
- location = 2
- end
- if not Vents then
- if location + 1 == 5 then
- Bonnie.Torso.CFrame = CFrame.new(
- workspace["Room"].CFrame.X,
- workspace["Room"].CFrame.Y + 1,
- workspace["Room"].CFrame.Z)
- *
- CFrame.Angles(Bonnie.Torso.CFrame:toEulerAnglesXYZ()
- )
- else
- Bonnie.Torso.CFrame = CFrame.new(
- workspace["Bonnie"..location].CFrame.X,
- workspace["Bonnie"..location].CFrame.Y + 1,
- workspace["Bonnie"..location].CFrame.Z)
- *
- CFrame.Angles(Bonnie.Torso.CFrame:toEulerAnglesXYZ()
- )
- end
- elseif Vents then
- if location + 1 >= 3 then
- Bonnie.Torso.CFrame = CFrame.new(
- workspace["Room"].CFrame.X,
- workspace["Room"].CFrame.Y + 1,
- workspace["Room"].CFrame.Z)
- *
- CFrame.Angles(Bonnie.Torso.CFrame:toEulerAnglesXYZ()
- )
- else
- Bonnie.Torso.CFrame = CFrame.new(
- workspace["LeftVent"..location].CFrame.X,
- workspace["LeftVent"..location].CFrame.Y + 1,
- workspace["LeftVent"..location].CFrame.Z)
- *
- CFrame.Angles(Bonnie.Torso.CFrame:toEulerAnglesXYZ()
- )
- end
- end
- end)
- spawn(function(s2)
- gamevalues.isOccupied.Changed:connect(function(change)
- wait(2)
- if isO.Value == true and oRoom.Value == "Bonnie" then
- if hoodStatus.Value ~= true then
- print('Dead Bonnie')
- else
- wait()
- Vents = false
- --TODO:Putting camera down
- location = 0
- isO.Value = not isO.Value
- oRoom.Value = ""
- print('Alive Bonnie')
- game.Players.LocalPlayer.PlayerGui.SoundAssets["In-Room Static"]:Stop()
- end
- end
- end)
- end)
- spawn(function(s)
- while wait(math.random(1, 5)) do -- 2, 3,4,5, 6,7
- local itemsrun = {
- ["2"] = true,
- ["7"] = true,
- ["3"] = true
- }
- local itemsretreat = {
- ["9"] = true
- }
- local enterVent = math.random(8, 13)
- local ventItems = {
- ["8"] = true,
- ["9"] = true,
- ["10"] = true
- }
- local variable = math.random(2, 15)--math.random(2, 7)
- if not Vents then
- if itemsrun[tostring(variable)] then
- if location + 1 == 4 and isO.Value == true then
- do
- end
- elseif location == 1 and ventItems[tostring(enterVent)] then
- --//Entering Vents\\--
- if ventItems[tostring(enterVent)] and gamevalues.leftVentOccupied.Value ~= true then
- print('Vent Entered')
- local Sound = game.Players.LocalPlayer.PlayerGui.SoundAssets.ventMovement1:Clone()
- Vents = true
- location = 0
- elseif gamevalues.leftVentOccupied.Value == true and ventItems[tostring(enterVent)] then
- print("Bonnie: Would've entered vent, but someone's occupying it. (Left)")
- end
- elseif location + 1 == 5 then
- if isO.Value == false then
- --//Is in room--\\
- game.Players.LocalPlayer.PlayerGui.SoundAssets["In-Room Static"]:Play()
- location = location + 1
- print'yesinroomBNHallway'
- isO.Value = true
- oRoom.Value = "Bonnie"
- else
- if oRoom.Value ~= "Bonnie" then
- location = 0
- end
- end
- else
- location = location + 1
- print('Moving one step.'..location)
- end
- --//Going Back\\--
- -- elseif itemsretreat[tostring(variable)] then
- -- if oRoom.Value == "Bonnie" then
- -- print('isinroom')
- -- else
- -- location = location - 1
- -- print'nay'
- -- end
- -- end
- --print(location, variable)
- end
- elseif Vents then
- print('vents')
- if itemsrun[tostring(variable)] then
- if location + 1 == 2 and isO.Value == true then
- do
- end
- elseif location + 1 == 3 then
- print'yesinroomBNVents'
- isO.Value = true
- oRoom.Value = "Bonnie"
- else
- local Sound = game.Players.LocalPlayer.PlayerGui.SoundAssets.ventMovement1:Clone()
- Sound.Parent = Bonnie
- Sound:Remove()
- location = location + 1
- end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment