Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Black Screen Fade In on Death and Out on Respawn?

Asked by 8 years ago
Edited 8 years ago

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:

01local black = script.Parent
02local humanoid = game.Players.LocalPlayer:FindFirstChild('Humanoid')
03 
04while true do
05    if humanoid.Died() then
06        for i = 1, 10 do
07            black.BackgroundTransparency = black.BackgroundTransparency - 0.10
08            wait(.1)
09        end
10    end
11    if humanoid == 100 then
12        for i = 1, 10 do
13            black.BackgroundTransparency = black.BackgroundTransparency + 0.10
14            wait(.1)
15        end
16    end
17    wait(1)
18end
0
Why did you do if humanoid == 100 humanoid will never equal 100 do you mean humanoid.Health? johndeer2233 439 — 8y
0
Oops, thanks for that, will test that now. Moshipikachu123456 15 — 8y
0
The black screen doesn't come up at all. That fixes one of the minor problems but its still not appearing. Moshipikachu123456 15 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago
01local black = script.Parent
02local humanoid = game.Players.LocalPlayer:FindFirstChild('Humanoid')
03 
04humanoid.Died:connect(function()
05        for i = 1, 10 do
06            black.BackgroundTransparency = black.BackgroundTransparency - 0.10
07            wait(.1)
08        end
09    if humanoid.Health == 100 then
10        for i = 1, 10 do
11             black.BackgroundTransparency = black.BackgroundTransparency + 0.10
12              wait(.1)
13            end
14        end
15end)

Here try this

0
Nope. No success. Moshipikachu123456 15 — 8y
0
DO you mind me going on team create? johndeer2233 439 — 8y
0
to look at your layout? johndeer2233 439 — 8y
0
sure Moshipikachu123456 15 — 8y
View all comments (4 more)
0
alright my username is johndeer2233 johndeer2233 439 — 8y
0
done. Moshipikachu123456 15 — 8y
0
Hello, did you lose connection? Moshipikachu123456 15 — 8y
0
yes sorry i did not come back on for 4 days sorry johndeer2233 439 — 8y
Ad

Answer this question