Hello, I just made a loading screen a few days ago and I realized something: the ScreenGui wont clone into a player on respawn even though it is placed into StarterGui. Here is part of the loading screen script:
local function GiveGui()
local MainGui = script:WaitForChild("Main"):Clone()
MainGui.Parent = game.StarterGui
MainGui:Clone().Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
game.Players.LocalPlayer:WaitForChild("PlayerGui"):SetTopbarTransparency(1)
end
It has ResetOnSpawn set to true.
Any help is appreciated!
I’m not entirely sure by what your actual goal is from the post, so I may be off. If it’s not what you meant, please let me know and I’ll provide some questions such that we can help you further.
This will not work because you are cloning the Gui into StarterGui using a script after the Player has joined the game.
The Gui will only be cloned into the Player when you directly drag it into StarterGui before the game even starts. E.G (Without a script & Dragging the Gui into the game.StarterGui folder)
ResetOnSpawn only works if the Gui was placed inside of the Player by dragging it into StarterGui, and not by cloning it in there with a script.
After that if they respawn the GUI will respawn as well. By the off chance you are not calling the GiveGui function by running it make sure you do that as well.
local function GiveGui()
--Insert Code here
end
GiveGui() --Make sure to run it
Please select as the answer if this solved your problem
Just make the whole GUI visible whenever you update/public the game and then disable it again so you can continue working on it. This will make it so everytime the player dies the whole function with the GUi starts over.
ScreenGui should automatically replicate into playergui. But if it doesn’t, try removing line 3 and replacing line 4 with MainGui.Parent = game.Players.LocalPlayer.PlayerGui