Here’s the rest of the script
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local TS = game:GetService("TweenService")
local MovingPart = game.Workspace:WaitForChild("MovingPart")
local StartPart = game.Workspace:WaitForChild("StartPart")
local GoalPart = game.Workspace:WaitForChild("GoalPart")
local SecretPart = game.Workspace:WaitForChild("DoorClosePos")
local SecretTruss = game.Workspace:WaitForChild("SecretTruss")
local SecretPlatform = game.Workspace:WaitForChild("SecretPlatform")
local WinPart = game.Workspace:WaitForChild("WinPart")
local CC = game.Lighting:WaitForChild("ColorCorrection")
local FadeOut = TS:Create(CC, TweenInfo.new(2), {TintColor = Color3.fromRGB(0, 0, 0)})
local FacilityStart = game.Workspace:WaitForChild("_FacilityStart")
local FacilityStop = game.Workspace:WaitForChild("_FacilityStop")
local StaticEnd = game.Workspace:WaitForChild("_StaticEnd")
local StaticStart = game.Workspace:WaitForChild("_StaticStart")
local StaticStop = game.Workspace:WaitForChild("_StaticStop")
local HouseBarrier = game.Workspace:WaitForChild("_HouseBarrier")
local HouseStart = game.Workspace:WaitForChild("_HouseStart")
local NonCanCollideModel = game.Workspace:WaitForChild("NonCanCollideModel")
local NoTurningBack = game.Workspace:WaitForChild("NoTurningBack")
local Door = NoTurningBack:WaitForChild("Door")
local Barrier = NoTurningBack:WaitForChild("Barrier")
local SecretButton = game.Workspace:WaitForChild("_SecretButton")
local FacilityMusic = script:WaitForChild("FacilityMusic")
local DarkRoom = script:WaitForChild("DarkRoom")
local HouseMusic = script:WaitForChild("HouseMusic")
local ShrineMusic = script:WaitForChild("ShrineMusic")
local Static = script:WaitForChild("StaticSound")
local Jumpscare = script:WaitForChild("Jumpscare")
local CurrentMusic = "Facility"
local debounce = false
MovingPart.Position = StartPart.Position
WinPart.Touched:Connect(function()
FadeOut:Play()
end)
FadeOut.Completed:Connect(function()
task.wait(1)
player:Kick("Please wait for all other players to finish the trial.")
end)
function Facility()
TS:Create(FacilityMusic, TweenInfo.new(2), {Volume = 1}):Play()
TS:Create(HouseMusic, TweenInfo.new(2), {Volume = 0}):Play()
TS:Create(ShrineMusic, TweenInfo.new(2), {Volume = 0}):Play()
TS:Create(Static, TweenInfo.new(2), {Volume = 0}):Play() -- error is here, i'm trying to make the volume go down with tweens
while CurrentMusic == "Facility" do wait() end
TS:Create(FacilityMusic, TweenInfo.new(2), {Volume = 0}):Play()
spawn(Music)
end
function House()
TS:Create(HouseMusic, TweenInfo.new(2), {Volume = 0.2}):Play()
TS:Create(FacilityMusic, TweenInfo.new(2), {Volume = 0}):Play()
TS:Create(ShrineMusic, TweenInfo.new(2), {Volume = 0}):Play()
TS:Create(Static, TweenInfo.new(2), {Volume = 0}):Play()
while CurrentMusic == "House" do wait() end
TS:Create(HouseMusic, TweenInfo.new(2), {Volume = 0}):Play()
spawn(Music)
end
function Shrine()
TS:Create(ShrineMusic, TweenInfo.new(0.5), {Volume = 0.1}):Play()
TS:Create(FacilityMusic, TweenInfo.new(0.5), {Volume = 0}):Play()
TS:Create(HouseMusic, TweenInfo.new(0.5), {Volume = 0}):Play()
TS:Create(Static, TweenInfo.new(0.5), {Volume = 0}):Play()
end
function Static()
local StaticTween = TS:Create(Static, TweenInfo.new(20), {Volume = 1})
StaticTween:Play()
TS:Create(FacilityMusic, TweenInfo.new(2), {Volume = 0}):Play()
TS:Create(HouseMusic, TweenInfo.new(2), {Volume = 0}):Play()
TS:Create(ShrineMusic, TweenInfo.new(2), {Volume = 0}):Play()
while CurrentMusic == "Static" do wait() end
StaticTween:Cancel()
TS:Create(Static, TweenInfo.new(2), {Volume = 0}):Play()
spawn(Music)
end
function None()
TS:Create(FacilityMusic, TweenInfo.new(2), {Volume = 0}):Play()
TS:Create(HouseMusic, TweenInfo.new(2), {Volume = 0}):Play()
TS:Create(ShrineMusic, TweenInfo.new(2), {Volume = 0}):Play()
TS:Create(Static, TweenInfo.new(2), {Volume = 0}):Play()
while CurrentMusic == "None" do wait() end
spawn(Music)
end
function Music()
if CurrentMusic == "Facility" then
spawn(Facility)
end
if CurrentMusic == "House" then
spawn(House)
end
if CurrentMusic == "Shrine" then
spawn(Shrine)
end
if CurrentMusic == "Static" then
spawn(Static)
end
if CurrentMusic == "None" then
spawn(None)
end
end
FacilityStart.Touched:Connect(function()
CurrentMusic = "Facility"
end)
FacilityStop.Touched:Connect(function()
CurrentMusic = "None"
end)
StaticStop.Touched:Connect(function()
CurrentMusic = "None"
end)
StaticStart.Touched:Connect(function()
CurrentMusic = "Static"
end)
StaticEnd.Touched:Connect(function()
CurrentMusic = "None"
end)
HouseStart.Touched:Connect(function()
CurrentMusic = "House"
HouseBarrier.CanCollide = true
end)
NoTurningBack.Touched:Connect(function()
if debounce then
return
end
debounce = true
DarkRoom.Volume = 0.5
DarkRoom:Play()
CurrentMusic = "Shrine"
Door.CanCollide = true
Barrier.CanCollide = true
TS:Create(game.Lighting, TweenInfo.new(0.5), {Ambient = Color3.fromRGB(0, 0, 0)}):Play()
end)
spawn(Music)
if script.Parent.Name == "Light1000_BOTTLE" then
MovingPart.CanCollide = true
MovingPart.Transparency = 0
SecretTruss.CanCollide = true
SecretTruss.Transparency = 0
SecretPlatform.CanCollide = true
SecretPlatform.Transparency = 0
SecretPart.CanCollide = false
for i, v in pairs(NonCanCollideModel:GetChildren()) do
if v:IsA("BasePart") then
v.Transparency = 1
v.CanCollide = false
end
end
task.wait(4)
TS:Create(MovingPart, TweenInfo.new(7, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true, 0.5), {Position = GoalPart.Position}):Play()
end
while SecretButton.Color == Color3.fromRGB(0, 255, 0) do wait() end
task.wait(10)
if debounce then
Jumpscare.Volume = 2
Jumpscare:Play()
TS:Create(Jumpscare, TweenInfo.new(3), {Volume = 0}):Play()
end