Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Black Screen Fade In on Death and Out on Respawn?

I want a black screen to fade in once the player has died and to fade out once they respawn. I've made a start and it doesn't seem to be appearing.

I have put a ScreenGui in the 'StarterGui' called 'BlackScreen', then a Frame inside the ScreenGui called 'Black' and then a LocalScript inside the Frame with the following:

local black = script.Parent
local humanoid = game.Players.LocalPlayer:FindFirstChild('Humanoid')

while true do
	if humanoid.Died() then
		for i = 1, 10 do
			black.BackgroundTransparency = black.BackgroundTransparency - 0.10
			wait(.1)
		end
	end
	if humanoid == 100 then
		for i = 1, 10 do
			black.BackgroundTransparency = black.BackgroundTransparency + 0.10
			wait(.1)
		end
	end
	wait(1)
end

3 comments

0

Why did you do if humanoid == 100 humanoid will never equal 100 do you mean humanoid.Health?

0

Oops, thanks for that, will test that now.

0

The black screen doesn't come up at all. That fixes one of the minor problems but its still not appearing.

1 answer

local black = script.Parent
local humanoid = game.Players.LocalPlayer:FindFirstChild('Humanoid')

humanoid.Died:connect(function()
        for i = 1, 10 do
            black.BackgroundTransparency = black.BackgroundTransparency - 0.10
            wait(.1)
        end
    if humanoid.Health == 100 then
        for i = 1, 10 do
           	 black.BackgroundTransparency = black.BackgroundTransparency + 0.10
          	  wait(.1)
        	end
    	end
end)

Here try this

8 comments

0

Nope. No success.

0

DO you mind me going on team create?

0

to look at your layout?

0

sure

0

alright my username is johndeer2233

0

done.

0

Hello, did you lose connection?

0

yes sorry i did not come back on for 4 days sorry

This discussion is preserved as it was. New answers, comments, and votes are closed.