Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is it possible to blur a players screen on death?

I am trying to blur certain players screens on there death or something else.

Whenever I use a blur since lighting is server side it does the same thing to all players. So when 1 player dies it replicated the blur effect to everyone.

Does anyone have any tutorials or know any that may be able to help me out.

Sorry I dont have the code in here, I dont really have any code at the moment. I have toyed around with blurring but it always blurs everyone.

Thank you for your time :)

1 comment

0

well if you figured out how to blur all the players, just put the same script into a LOCAL script so It only does it for each individual player when they die.

3 answers

✓ Accepted answer

I'm a bit late to the party, but here's my solution. It works similar to Godlydeathdragon's script, but it uses a Tween to gradually fade the blur. It also includes 2 options to set the delay before the blur starts fading in after death, and the duration of the fade-in. Just like Godlydeathdragon's script, this should be in a LocalScript in StarterPlayerScripts

local TweenService = game:GetService("TweenService")
local blurDelay = 0 --seconds
local blurDuration = 6 --seconds
local blurEffect = Instance.new("BlurEffect")
blurEffect.Size = 0
blurEffect.Enabled = false
blurEffect.Parent = game.Workspace.CurrentCamera
local tween

local function createTween()
	local tweenInfo = TweenInfo.new(blurDuration, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, blurDelay)
	return TweenService:Create(blurEffect, tweenInfo, {Size = 56})
end

game.Players.LocalPlayer.CharacterAdded:Connect(function(character)
	local humanoid = character:WaitForChild("Humanoid")
	if tween and tween.PlaybackState == Enum.PlaybackState.Playing then
		tween:Cancel()
	end
	blurEffect.Size = 0
	blurEffect.Enabled = false
	humanoid.Died:Connect(function()
		blurEffect.Enabled = true
		tween = createTween()
		tween:Play()
	end)
end)

By setting the blur effect's parent to the player's Camera, I believe this will make only the player who died see the blur effect

PUT THIS SCRIPT IN STARTERPLAYER UNDER STARTERCHARACTERSCRIPTS

local char = script.Parent

local humanoid = char:FindFirstChild("Humanoid")

local camera = workspace.CurrentCamera

humanoid.HealthChanged:connect(function(health)
	if health == 0 then
		game.Lighting.Blur.Enabled = true
		game.Lighting.Blur.Parent = camera
	end
end)

4 comments

0

This doesnt work... Sorryyy, but why is this problem so hard. Ive seen very basic games have this ya know XD. Any other ideas?

0

Oh no it seems it does work, I changed it and now it does work... Hmm a little odd but as long as it works! :) thanks my dude.

0

just wondering, does humanoid:Died() function has the same effect?

0

Yes, but instead you use humanoid.Died:connect(function() or something similar to that

local player = game.Players.LocalPlayer
local Character = player.Character
local Humanoid = Character:WaitForChild("Humanoid")
local Blurdeadfind = game.Lighting:FindFirstChild("Blurdead")
local ColorDead = game.Lighting:FindFirstChild("ColorDead")
if Blurdeadfind and ColorDead then
	game:GetService("TweenService"):Create(Blurdeadfind,TweenInfo.new(1,Enum.EasingStyle.Linear),{Size = 0}):Play()
	game:GetService("TweenService"):Create(ColorDead,TweenInfo.new(1,Enum.EasingStyle.Linear),{Brightness = 0}):Play()
	wait(2)
	Blurdeadfind:Destroy()
	ColorDead:Destroy()
	else
end
Humanoid.Died:Connect(function()
	local cam = game.Workspace.CurrentCamera
	cam:ClearAllChildren()
	local BlurDead = Instance.new("BlurEffect",game.Lighting)
	local ColorCorr = Instance.new("ColorCorrectionEffect",game.Lighting)
	ColorCorr.Name = "ColorDead"
	BlurDead.Size = 0
	game:GetService("TweenService"):Create(BlurDead,TweenInfo.new(1,Enum.EasingStyle.Linear),{Size = 56}):Play()
	game:GetService("TweenService"):Create(ColorCorr,TweenInfo.new(2,Enum.EasingStyle.Linear),{Brightness = -1}):Play()
	BlurDead.Name = "Blurdead"
end)

This is for those who are searching for this and are sent here ;P

This discussion is preserved as it was. New answers, comments, and votes are closed.