Why doesn't the death screen appear?

I have a death screen for when you die and it works, but when you get killed by the monster, it doesn’t work. you do get killed but the screen doesn’t appear. code:

plr.Character:WaitForChild("Humanoid").Health = 0

yes, i am using humanoid.Died.

There is not enough code here to know. There must be something wrong with the code that is responsible for showing the UI. Just showing the line to kill the player isn’t enough information to know for sure what you’re doing wrong. If you could please share a .rbxm or .rbxl file and post some more of the source code there is a much greater chance your problem will be resolved quickly.

no. a whole .rbxl file?! plus, i said in my post that the death screen works, and the line does kill the player but the player doesn’t die. what info do you need?

the title of the post is “Why Doesn’t the Death Screen Appear?” not “Why is the humanoid not dying”

The Humanoid is most likely not dying because you’re attempting to kill the humanoid from a LocalScript. Only Server Scripts have the power to kill a humanoid.

I SAID IT KILLS THE PLAYER. IT WORKS. THE SCREEN ISN’T APPEARING. IT’S A SERVER SCRIPT. Did you read the topic?

Umm. I think he’s asking you for the code that handles the deathscreen UI itself. Alternatively, can you also post a log of your f9 console and check for errors?

no errors on either scripts. 30

…Could you send the code for the UI and the Monster death part itself…? We can’t really help you without seeing what the problem is.

	root.Touched:Connect(function(hit)
	local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
	if plr then
		script.Parent:WaitForChild("Jumpscare"):Play()
		animation:Play()
		root.CanTouch = false
		humanoid.WalkSpeed = 0
		plr.Character:WaitForChild("Humanoid").WalkSpeed = 0
		plr.PlayerGui:WaitForChild("RunningScript"):Destroy()
		plr.Character:MoveTo(script.Parent.Reposition.Position)
		animation.Stopped:Connect(function()
			plr.Character:WaitForChild("Humanoid").Health = 0
repeat wait() until game.Players.LocalPlayer.Character
repeat wait() until game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
humanoid.Died:Connect(function()

i didn’t include the tweens beacuse i know they work. i included the important parts.

What’s the full code for this (before too?) It’s hard to tell what’s going on in your script when you’ve cut out 90% of the code.

it’s just variables for the tweens (tween info, tween goal and tween creation)

My issue still persists - How are you defining Humanoid? How are you getting said variables?

Also, you do not need to run :WaitForChild() every time. You could just turn it into a variable then go from there.

What about this part? Is it firing correctly or not?

yes, it is killing the player.

The problem lies on the UI code itself. Had you sent the full uncut version, I could’ve known what’s wrong.

repeat wait() until game.Players.LocalPlayer.Character
repeat wait() until game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
local redscreen = script.Parent.Parent.RedScreen
local ts = game:GetService("TweenService")
local ti = TweenInfo.new(10,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out)
local ti2 = TweenInfo.new(2,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out
)
local ti3 = TweenInfo.new(2,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out
)
local ti4 = TweenInfo.new(2,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out
)

local ti5 = TweenInfo.new(2,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out
)
local tg = {BackgroundColor3 = Color3.fromRGB(0, 0, 0)}
local tg2 = {TextTransparency = 0}
local tg3 = {TextTransparency = 0}
local tg4 = {TextTransparency = 0}
local tg5 = {TextTransparency = 0}
local tc = ts:Create(redscreen, ti, tg)
local tc2 = ts:Create(script.Parent.MenuButton, ti2, tg2)
local tc3 = ts:Create(script.Parent.RestartButton, ti3, tg3)
local tc4 = ts:Create(script.Parent.DeathText, ti4, tg4)
local tc5 = ts:Create(script.Parent.RestartChButton, ti5, tg5)
local humanoid = game.Players.LocalPlayer.Character.Humanoid
humanoid.Died:Connect(function()
	script.Parent.Parnt.Parent.RunningScript:Destroy()
	game:GetService("UserInputService").ModalEnabled = true
	script.Parent.Parent.Parent.GamePaused:Destroy()
	redscreen.Visible = true
	tc:Play()
	tc.Completed:Connect(function()
	redscreen.Visible = false
	script.Parent.Visible = true
	tc2:Play()
	tc3:Play()
	tc4:Play()
	tc5:Play()
		print("Death screen appeared")
		end)
	end)

is Death Screen Appeared printing?

How did this not throw an error? I assume that “Parnt” means parent here. Looks like this isn’t even running to begin with.

ok i’m not sure how it’s not erroring because that wasn’t intentional and worked when i screwed with the humanoid and fell in the void.

no .Died is an event but i found the issue. i’m going to try after i fix the code.

my solution didn’t work… this is strange. No errors.