I made a killcam script that works fine for the most part, but after the kill-cam happens, the players chat is permanently disabled, I have no idea what causes this. Any and all help will be appreciated. This is the script(Local Script inside of the StarterGui)

local player = script.Parent.Parent 
repeat wait() until workspace.CurrentCamera 
repeat wait() until player.Character 
local C = workspace.CurrentCamera 

C.CameraSubject = player.Character.Humanoid -- Reset the CameraSubject to the humanoid
C.CameraType = "Custom" -- Reset the CameraType to Custom

player.Character.Humanoid.Died:connect(function() 
    local killer = player.Character.Humanoid:findFirstChild("creator") 
    if killer then 
        for _,v in pairs(script.Parent:children()) do 
            if v.Name ~= "KillCam" then 
                v:remove() 
            end
        end 
        local G = Instance.new("ScreenGui",player.PlayerGui) 
        local F1 = Instance.new("Frame",G) 
        local F2 = Instance.new("Frame",G) 
        F1.BackgroundColor3 = Color3.new(0/255,0/255,0/255) 
        F2.BackgroundColor3 = Color3.new(0/255,0/255,0/255) 
        F1.Size = UDim2.new(1,0,0,0) F2.Size = UDim2.new(1,0,0,0) 
        F2.Position = UDim2.new(0,0,.85,0)
        spawn(function() 
            for i= 1, 15 do 
                wait() 
                F1.Size = F1.Size + UDim2.new(0,0,.01,0) 
                F2.Size = F2.Size + UDim2.new(0,0,.01,0) 
                F2.Position = UDim2.new(0,0,1-(i*.01),0) 
            end 
        end) 
        C.CameraSubject = killer.Value.Character 
        C.CameraType = "Attach"
    end 
end)