Looking to do 3 things … #1. On starting and re-spawn the screen comes in black. #2. Screen fades out the black after each spawn. #3. On death screen fades to black.
Seems easy right? It’s not turning out that way …
The screen is to remain black after death and load until the fade black out.
This is a bit of a hit or miss when the program is published.
This don’t work … but it should. FadeGUI.rbxm (6.7 KB)
maybe you sould try disabling ResetOnSpawn property from the BlackScreenGUI see if that solves it. Otherwise send your code attempts so I can see whats going on
Here is a fixed solution to your problems. Below I have inserted the physical place that you can download or if you want you can also just download the physical model. Feel free to study the code and learn from the mistakes that were made
There are many ways of going about this but this is what I am proposing to you.
The problem was that you were making it more complicated than it needed to be. The gui can be accessed by itself due to it being cloned into the playerGui already so there is no need to access the player and then try to get into the gui. I made changes accordingly so I hope this helps you out.
This doesn’t completely work …
Here is a totally stripped down version and this one doesn’t completely work. fade.rbxm (3.7 KB)
As fast as possible
drp = script.Parent.drop
function Drop(mode)
if mode then drp.BackgroundTransparency = 0
repeat task.wait(0.02)
drp.BackgroundTransparency += 0.1
until(drp.BackgroundTransparency >=1)
drp.BackgroundTransparency = 1
else drp.BackgroundTransparency = 1
repeat task.wait(0.02)
drp.BackgroundTransparency -= 0.1
until(drp.BackgroundTransparency <=0)
drp.BackgroundTransparency = 0
end
end task.wait(1)
Drop(true)
plr = game.Players.LocalPlayer
chr = plr.Character or plr.CharacterAdded:Wait()
chr:WaitForChild("Humanoid").Died:Connect(function()
Drop(false)
end)
The real problem here is Roblox doesn’t come up with a black screen by default (or have an option for that). When you get a game load that takes more than 3 seconds. You’re not connected fast enough to Roblox to have any GUI show before the you get the default not black screen load …
This all looks good in the studio but is not consistent when published.
An alternative method you can use to set the background visible at first instance is that you can just set the background to visible = true manually in the properties so that way when the game starts, it is already visible as shown in the place example.
Not sure you understand what I’m looking to do here …
This should come up black. It is visible and set to black. That is still not fast enough to consistently load up as a black screen. It takes too long to even set up the GUI, even if there was no code at all …
If Roblox is running slow or your connect is slow at all … There is no possible way to get a black screen load up via GUI. What I need here apparently is an option to load to a black screen added to the studio.
The problem isn’t with the GUI. The problem is with lag. You can not consistently get a set to black GUI to load up fast enough to stop a “screen flash” on respawns. Even if that GUI has no script to it at all. This may work 10 times, but on the slower load … it will flash.
With my GUI set up as black by default and running the code “As fast as possible” from my reply a few back. When published if the game loadup takes more than 3 seconds. My respawns will screen flash.
I’d assume the “screen flash” is occurring due to StarterGui not being fast enough replicate the fade into PlayerGui, but thats just a theory (pun not intended)
Not fast enough to even come up black … before you even get to fading anything.
It will once loaded but there is a moment of not black. aka “screen flash”
Respawning causes issues like yours for some reason, my module im working on had a issue with respawning and caused the UI to never even load on respawn, i somehow fixed the issue though, i’ll check the code when i use my laptop to see how i fixed it and maybe it could help you.
ResetOnSpawn Dosen’t work when parented into PlayerGui instead of being replicated into it via StarterGui, the code i used was similar to the code i provided above, but it did not work for some reason.
This is an odd error as it doesn’t happen all the time. It’s when you get a slower connect to Roblox. That time it took 4-5 seconds to load up. On respawns it is just a fraction of a second too slow to set up that black GUI without a “screen flash”. When published this happens not in Studio.