Using ReplicatedStorage to store Uis

I have a UI that I want to show at the begining of the game right after the game loads, I used the DevHub’s loading screen code to do this. But, I want to store the UI in replicated storage so i can show it after the game loads, and whenever you press the menu button (local script) How would I do this?

If you could help that would be great!
Thanks! :smile:

2 Likes

Try something similar to:

Button.MouseButton1Click:Connect(function()
local GUI = ReplicatedStorage.Gui:Clone()
Gui.Parent = LocalPlayer.PlayerGui
end)
2 Likes

I don’t understand your code structure, but you’d simply wait for the game to load, then parent the UI to the “PlayerGui” folder inside of the player object.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = game:GetService("Players").LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local ui; — insert the path to ui here.

if not game:IsLoaded() then — if the game isn’t loaded then...
    game.Loaded:Wait() — wait for the game to load!
end

ui.Parent = playerGui

Give the Custom Loading Screens a good read, everything you need to know should be answered there.

1 Like

here’s my code currently

and the gui does not show at start

local Players = game:GetService("Players")
local player = Players.LocalPlayer 
local playerGui = player:WaitForChild("PlayerGui")
local startMenu = game.ReplicatedStorage.StartMenu:Clone()

if not game:IsLoaded() then
	game.Loaded:Wait()
end
startMenu.Parent = playerGui

1 Like

Is the Visible property set to true?

1 Like

i used this loading screen template before, and it worked with the gui being parented to the localscript in replicatedfirst. now i want to use this gui in both after the loading screen and through a ui local script, so i assume it should be stored in replicated storage, but nothing seems to be working

1 Like

yes it is


1 Like

I fixed the issue. I needed to do
game:WaitForChild(ReplicatedStorage) to get replicated storage from replicatedfirst

1 Like