Probably because you assigned char two times. So when they die, it has probably already loaded and your just infinitely waiting for the char to load again but it already has. Idk may be not the case but, considering trying it out. All in all, if it works, your code should be like this:
local blackscreen = game.Players.LocalPlayer.PlayerGui:WaitForChild("BlackScreen").Frame
local ts = game:GetService("TweenService")
local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
char:WaitForChild("Humanoid").Died:Connect(function()
ts:Create(blackscreen, TweenInfo.new(3, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
wait(4)
game:GetService("Lighting")["ANOTHER BLUR"].Enabled = true
ts:Create(blackscreen, TweenInfo.new(1, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
wait(1.5)
---char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
--remove this ^^^
game:GetService("Lighting")["ANOTHER BLUR"].Enabled = false
end)
edit: You can also use a more reliable way using health changed signal (have not tested this out. lmk if it errors):
local blackscreen = game.Players.LocalPlayer.PlayerGui:WaitForChild("BlackScreen").Frame
local ts = game:GetService("TweenService")
local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
char:WaitForChild("Humanoid"):GetPropertyChangedSignal("Health"):Connect(function(health)
if health == 0 then
ts:Create(blackscreen, TweenInfo.new(3, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
wait(4)
game:GetService("Lighting")["ANOTHER BLUR"].Enabled = true
elseif health == 100 then
ts:Create(blackscreen, TweenInfo.new(1, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
wait(1.5)
char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
game:GetService("Lighting")["ANOTHER BLUR"].Enabled = false
end
end)
If u want to use CharacterAdded, then u need to use PlayerAdded. If u want to use .Died:Connect for your CharacterAdded Event, then u need to use .Died:Connect.
For one, you use local player, which completely removes the need of using the PlayerAdded, since this should be a local script and not a server script.
Wouldn’t recommend handling a player’s UI within a server script or handling lighting within a server script
Thats a Localscript, and handling Lighting can be done in Server or Client there is no recommending, on Server if it should be for all Players or in Client if its should be for One Player, Client will not be replace to Server for Lighting anyways
oh and another note, this script also has the same problem, whenever a gun fires in full-auto the character is supposed to walk, however also does it once and goes to sleep
game.ReplicatedStorage.ShootEvent.OnServerEvent:Connect(function(player)
local character = player.Character or player.CharacterAdded:Wait()
player.PlayerGui["Realism Mod"].Sprint.Enabled = false
character:WaitForChild("Humanoid").WalkSpeed = 10
wait(0.01)
player.PlayerGui["Realism Mod"].Sprint.Enabled = true
end)