I have a script that would enable a blur effect when the player dies. It works perfectly when i test it on studio, but when i test in game i get an error saying "Blur is not a valid member of Camera" Any idea why the game deletes it? This is a LocalScript by the way.
wait(1)
player = script.Parent.Parent.Parent.Parent.Character
hum = player.Humanoid
local blur = workspace.CurrentCamera.Blur
local color = workspace.CurrentCamera.Color
while true do
wait(0.1)
if hum.Health < 1 then
blur.Enabled = true
color.Enabled = true
for i = 5,15,0.1 do
blur.Size = i
end
else
blur.Enabled = false
blur.Size = 0
color.Enabled = false
end
end
SOLVED: Instead of placing the BlurEffect in workspace.Camera, i used
Instance.new("BlurEffect", workspace.CurrentCamera)

3 comments
Let me guess, ServerScript?
No, LocalScript.
Put it in Lighting.