local Plr = game.Players.LocalPlayer
PlayerGui = Plr.PlayerGui or Plr:WaitForChild("PlayerGui")
wait()
for _, UI in pairs(game.StarterGui:GetChildren()) do
local a = UI:Clone()
a.Parent = PlayerGui
end
I thought just as much, I can provide a better method for ya. First create a folder named UI inside ReplicatedStorage. After that, insert a script in ServerScriptService (or just use the Loader script if you are using a framework) and paste the following code inside it.
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StarterGui = game:GetService("StarterGui")
local UIFolder = ReplicatedStorage:WaitForChild("UI")
Players.PlayerAdded:Connect(function(player)
for _, ui in StarterGui:GetChildren() do
local clone = ui:Clone()
clone.Parent = UIFolder
end
end)
Then from a local script in StarterPlayerScripts, move the contents of that previously mentioned UI folder to playerGui
local PlayerGui = player:WaitForChild("PlayerGui")
for _, ui in StarterGui:GetChildren() do
ui.Parent = UIFolder
end