Memoriam Camera
Key RequiredUniversal

Memoriam Camera

Universal Scriptnachovazsuanachovazsua 4.4K views 30 executesUpdated May 4, 2025
5.0/ 5(1 votes)
10100% Positive
Lua Script•123 lines (3254 chars)
local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")
local RunService = game:GetService("RunService")

local player = Players.LocalPlayer

-- GUI setup
local gui = Instance.new("ScreenGui")
gui.Name = "DeathCamGui"
gui.ResetOnSpawn = false
gui.IgnoreGuiInset = true
gui.Enabled = false
gui.Parent = player:WaitForChild("PlayerGui")

local black = Instance.new("Frame")
black.Size = UDim2.new(1, 0, 1, 0)
black.BackgroundColor3 = Color3.new(0, 0, 0)
black.BackgroundTransparency = 0
black.ZIndex = 0
black.Parent = gui

local viewport = Instance.new("ViewportFrame")
viewport.Size = UDim2.new(0.3, 0, 0.3, 0)  -- Smaller square size
viewport.Position = UDim2.new(0.5, 0, 0.5, 0)
viewport.AnchorPoint = Vector2.new(0.5, 0.5)
viewport.BackgroundTransparency = 1
viewport.ImageTransparency = 1
viewport.ZIndex = 1
viewport.Parent = gui

local cam = Instance.new("Camera")
cam.Name = "DeathCam"
cam.Parent = viewport
viewport.CurrentCamera = cam

-- Clear GUI and viewport
local function clear()
	gui.Enabled = false
	for _, obj in ipairs(viewport:GetChildren()) do
		if not obj:IsA("Camera") then
			obj:Destroy()
		end
	end
	viewport.ImageTransparency = 1
end

-- Clone everything in the workspace
local function cloneWorkspaceContents()
	local container = Instance.new("Model")
	container.Name = "ClonedScene"

	-- Iterate through all workspace contents and clone them
	for _, inst in ipairs(Workspace:GetChildren()) do
		local success, clone = pcall(function()
			return inst:Clone()
		end)

		if success and clone then
			-- Anchor parts and set CanCollide to false
			for _, part in ipairs(clone:GetDescendants()) do
				if part:IsA("BasePart") then
					part.Anchored = true
					part.CanCollide = false
				end
			end
			clone.Parent = container
		end
	end

	return container
end

-- Show the viewport death scene
local function showDeathCam(char)
	local root = char:FindFirstChild("HumanoidRootPart")
	if not root then return end

	gui.Enabled = true

	local clonedScene = cloneWorkspaceContents()
	clonedScene.Parent = viewport

	-- Set camera to match the player's actual camera
	local playerCamera = game.Workspace.CurrentCamera
	cam.CFrame = playerCamera.CFrame -- Set the ViewportFrame camera to match the player's camera

	-- Adjust the camera's position and FOV to show a cropped view
	local offset = Vector3.new(0, 2, 5)  -- Offset slightly to center on character
	cam.CFrame = cam.CFrame * CFrame.new(offset)

	-- Apply a tighter field of view to focus on the character and surroundings
	cam.FieldOfView = 50  -- Adjust this value to crop more/less around the character

	-- Fade in the viewport image more slowly
	for i = 1, 30 do  -- Slower fade (can adjust the value for longer or shorter fade)
		viewport.ImageTransparency = 1 - (i * 0.033)  -- Fade over 1 second
		RunService.RenderStepped:Wait()
	end

	task.wait(2) -- hold the image for 2 seconds

	clear()
end

-- Connect to death
local function onCharacter(char)
	local hum = char:WaitForChild("Humanoid", 5)
	if not hum then return end

	hum.Died:Connect(function()
		showDeathCam(char)
	end)
end

-- Init
if player.Character then
	onCharacter(player.Character)
end

player.CharacterAdded:Connect(function(char)
	clear()
	onCharacter(char)
end)

Features & Information

Its kinda broken, but its named like this as before all of this it was supposed to be just the memoriam meme for your own character that happened every time you die, but couldnt get that to work really. oh yeah and forgot to mention, theres no grayscale unfortunately

Community Comments (2)

tonythaf72tonythaf72Jun 28, 2025

Doesn't show my character :c

nachovazsuanachovazsuaJun 29, 2025

yeah i dunno whats up with that happening to be honest...

More Scripts for Universal Scripts