function PlayCutscene()if bin then bin=false if ProtectTheCharacterWhilePlaying and(ProtectTheCharacterWhilePlaying.Value and Player.Character)then CharacterProtector.Parent=Player.Character end Demo:Play()end end Demo.EStop.Event:Connect(function()wait_time(Debounce.Value)CharacterProtector.Parent=nil if PlayOnce then if not PlayOnce.Value then bin=true end else bin=true end if StopMusicWhenFinished and StopMusicWhenFinished.Value then if OnFinishedRemove then for c,X in pairs(OnFinishedRemove:GetChildren())do if X:IsA("\079\098\106\101\099\116\086\097\108\117\101")then if X.Value then X.Value:Destroy()end end end end end end)
-- Support for debounce
function PlayCutscene()
	if bin then
		bin = false
		if ProtectTheCharacterWhilePlaying and ProtectTheCharacterWhilePlaying.Value and Player.Character then
			CharacterProtector.Parent = Player.Character
		end
		Demo:Play()
	end
end

Demo.EStop.Event:Connect(function()
	wait_time(Debounce.Value)
	CharacterProtector.Parent = nil
	if PlayOnce then
		if not PlayOnce.Value then
			bin = true
		end
	else
		bin = true
	end
	if StopMusicWhenFinished and StopMusicWhenFinished.Value then
		if OnFinishedRemove then
			for i, v in pairs(OnFinishedRemove:GetChildren()) do
				if v:IsA("ObjectValue") then
					if v.Value then
						v.Value:Destroy()
					end
				end
			end
		end
	end
end)
