Reset camera effects on Player Death?

Hello, the game i am working on has alot of visual effects like Blurs and Color corrections.
When the player dies, i would like the Camera to Reset.

  • What is the best way to do so? My code just does not work
    Script (in Starter Character Scripts):

local model = script.Parent

model.Humanoid.Died:connect(function()
script.Effect.Disabled=false
wait()
end)

  • Localscript named Effect inside the script:

game.Workspace.Camera:ClearAllChildren()
game.Workspace.Camera.FieldOfView = 70

wait()
for i,n in pairs(game.Workspace:GetDescendants()) do
if n.ClassName == “EqualizerSoundEffect” then
wait()
n:Destroy()
end
end

print(“cleared”)

To do the connect thing, I recommend you use this:

game.Players.PlayedAdded:Connect(function(player)
    player.CharacterRemoving:Connect(function()
        --here you remove the effects
    end
end)

If you want to remove the effect client-side that are in workspace, I recommend you use CollectionService to tag them so you can just get them instantly instead of having to loop through the entire workspace. To use the full power of CollectionService, get this plugin: Tag Editor - Roblox.

1 Like

Thanks for your reply, i will do the following