Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is it possible to blur a players screen on death?

Asked by 7 years ago

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 :)

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. Au_Naturel -26 — 5y

3 answers

Log in to vote
1
Answered by 7 years ago

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

01local TweenService = game:GetService("TweenService")
02local blurDelay = 0 --seconds
03local blurDuration = 6 --seconds
04local blurEffect = Instance.new("BlurEffect")
05blurEffect.Size = 0
06blurEffect.Enabled = false
07blurEffect.Parent = game.Workspace.CurrentCamera
08local tween
09 
10local function createTween()
11    local tweenInfo = TweenInfo.new(blurDuration, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, blurDelay)
12    return TweenService:Create(blurEffect, tweenInfo, {Size = 56})
13end
14 
15game.Players.LocalPlayer.CharacterAdded:Connect(function(character)
View all 27 lines...
Ad
Log in to vote
2
Answered by 7 years ago
Edited 7 years ago

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

01local char = script.Parent
02 
03local humanoid = char:FindFirstChild("Humanoid")
04 
05local camera = workspace.CurrentCamera
06 
07humanoid.HealthChanged:connect(function(health)
08    if health == 0 then
09        game.Lighting.Blur.Enabled = true
10        game.Lighting.Blur.Parent = camera
11    end
12end)
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? GottaHaveAFunTime 218 — 7y
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. GottaHaveAFunTime 218 — 7y
0
just wondering, does humanoid:Died() function has the same effect? PumpedRedfalconPE 17 — 7y
0
Yes, but instead you use humanoid.Died:connect(function() or something similar to that Godlydeathdragon 227 — 7y
Log in to vote
0
Answered by 5 years ago
01local player = game.Players.LocalPlayer
02local Character = player.Character
03local Humanoid = Character:WaitForChild("Humanoid")
04local Blurdeadfind = game.Lighting:FindFirstChild("Blurdead")
05local ColorDead = game.Lighting:FindFirstChild("ColorDead")
06if Blurdeadfind and ColorDead then
07    game:GetService("TweenService"):Create(Blurdeadfind,TweenInfo.new(1,Enum.EasingStyle.Linear),{Size = 0}):Play()
08    game:GetService("TweenService"):Create(ColorDead,TweenInfo.new(1,Enum.EasingStyle.Linear),{Brightness = 0}):Play()
09    wait(2)
10    Blurdeadfind:Destroy()
11    ColorDead:Destroy()
12    else
13end
14Humanoid.Died:Connect(function()
15    local cam = game.Workspace.CurrentCamera
View all 24 lines...

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

Answer this question