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 :)
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
01 | local TweenService = game:GetService( "TweenService" ) |
02 | local blurDelay = 0 --seconds |
03 | local blurDuration = 6 --seconds |
04 | local blurEffect = Instance.new( "BlurEffect" ) |
05 | blurEffect.Size = 0 |
06 | blurEffect.Enabled = false |
07 | blurEffect.Parent = game.Workspace.CurrentCamera |
08 | local tween |
09 |
10 | local 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 } ) |
13 | end |
14 |
15 | game.Players.LocalPlayer.CharacterAdded:Connect( function (character) |
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
01 | local char = script.Parent |
02 |
03 | local humanoid = char:FindFirstChild( "Humanoid" ) |
04 |
05 | local camera = workspace.CurrentCamera |
06 |
07 | humanoid.HealthChanged:connect( function (health) |
08 | if health = = 0 then |
09 | game.Lighting.Blur.Enabled = true |
10 | game.Lighting.Blur.Parent = camera |
11 | end |
12 | end ) |
01 | local player = game.Players.LocalPlayer |
02 | local Character = player.Character |
03 | local Humanoid = Character:WaitForChild( "Humanoid" ) |
04 | local Blurdeadfind = game.Lighting:FindFirstChild( "Blurdead" ) |
05 | local ColorDead = game.Lighting:FindFirstChild( "ColorDead" ) |
06 | if 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 |
13 | end |
14 | Humanoid.Died:Connect( function () |
15 | local cam = game.Workspace.CurrentCamera |
This is for those who are searching for this and are sent here ;P