RunService.RenderStepped:Connect(function(k)Demo:Update(k)end)if PlayOnPlayerJoin and PlayOnPlayerJoin.Value then PlayCutscene()end if PlayOnPartTouch then local k=script.PlayOnPartTouch.Value if k and k:IsA("\066\097\115\101\080\097\114\116")then k.Touched:Connect(function(k)if k.Parent==Player.Character then PlayCutscene()end end)end PlayOnPartTouch:Destroy()end if PlayOnEventFire then local k=PlayOnEventFire.Value if k and k:IsA("\066\105\110\100\097\098\108\101\069\118\101\110\116")then k.Event:Connect(PlayCutscene)end PlayOnEventFire:Destroy()end if PlayOnRemoteEventFire then local k=PlayOnRemoteEventFire.Value if k and k:IsA("\082\101\109\111\116\101\069\118\101\110\116")then k.OnClientEvent:Connect(PlayCutscene)end PlayOnRemoteEventFire:Destroy()end if StopOnRemoteEventFire then local k=StopOnRemoteEventFire.Value if k and k:IsA("\082\101\109\111\116\101\069\118\101\110\116")then k.OnClientEvent:Connect(function()Demo:Stop()end)end StopOnRemoteEventFire:Destroy()end if StopOnRemoteEventFire then local k=StopOnRemoteEventFire.Value if k and k:IsA("\082\101\109\111\116\101\069\118\101\110\116")then k.OnClientEvent:Connect(function()Demo:Stop()end)end StopOnRemoteEventFire:Destroy()end local k=Player.Character or Player.CharacterAdded:Wait()if PlayOnCharacterDied and PlayOnCharacterDied.Value then local u=k:WaitForChild("\072\117\109\097\110\111\105\100");(k:WaitForChild("\072\117\109\097\110\111\105\100")).Died:Connect(function()PlayCutscene()end)end PlayCutscene()

RunService.RenderStepped:Connect(function(Delta)
	Demo:Update(Delta)
end)

if PlayOnPlayerJoin and PlayOnPlayerJoin.Value then
	-- Play the cutscene
	PlayCutscene()
end

if PlayOnPartTouch then
	local part = script.PlayOnPartTouch.Value
	if part and part:IsA("BasePart") then
		part.Touched:Connect(function(hit)
			if hit.Parent == Player.Character then
				PlayCutscene()
			end
		end)
	end
	PlayOnPartTouch:Destroy()
end

if PlayOnEventFire then
	local e = PlayOnEventFire.Value
	if e and e:IsA("BindableEvent") then
		e.Event:Connect(PlayCutscene)
	end
	PlayOnEventFire:Destroy()
end

if PlayOnRemoteEventFire then
	local e = PlayOnRemoteEventFire.Value
	if e and e:IsA("RemoteEvent") then
		e.OnClientEvent:Connect(PlayCutscene)
	end
	PlayOnRemoteEventFire:Destroy()
end

if StopOnRemoteEventFire then
	local e = StopOnRemoteEventFire.Value
	if e and e:IsA("RemoteEvent") then
		e.OnClientEvent:Connect(function()
			Demo:Stop()
		end)
	end
	StopOnRemoteEventFire:Destroy()
end

if StopOnRemoteEventFire then
	local e = StopOnRemoteEventFire.Value
	if e and e:IsA("RemoteEvent") then
		e.OnClientEvent:Connect(function()
			Demo:Stop()
		end)
	end
	StopOnRemoteEventFire:Destroy()
end

local Character = Player.Character or Player.CharacterAdded:Wait()

if PlayOnCharacterDied and PlayOnCharacterDied.Value then
	local Humanoid = Character:WaitForChild("Humanoid")
	Character:WaitForChild("Humanoid").Died:Connect(function()
		PlayCutscene()
	end)
end
PlayCutscene()
