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 7 years ago
Edited 7 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:

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
0
Why did you do if humanoid == 100 humanoid will never equal 100 do you mean humanoid.Health? johndeer2233 439 — 7y
0
Oops, thanks for that, will test that now. Moshipikachu123456 15 — 7y
0
The black screen doesn't come up at all. That fixes one of the minor problems but its still not appearing. Moshipikachu123456 15 — 7y

1 answer

Log in to vote
1
Answered by 7 years ago
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

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

Answer this question