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?
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.
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
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