How do i parent a gui to all players?

So im trying to parent a gui to all players but im not sure how

local players = game.Players.LocalPlayer
newParty.Parent = players.PlayerGui.PlayGui.GamesMade.Duplicates

So you want the same gui for all players? Just put it into starter gui and everyone can see it when they join.

What you can do is clone the gui, and send the clone to the players.

Example:

local Players = game.Players
local Gui = --Your gui

for i,v in pairs(players:GetChildren()) do
local Clone = Gui:Clone()
Clone.Parent = v.PlayerGui
end

I’m not 100% sure this will work, but give it a try.

isn’t startergui just a copy of playergui?

Startergui just puts the gui you put in it to all players when they join

i already tried something like that and it didn’t work

nope still doesn’t work

what do you mean it doesnt work? Im not sure what you are trying to do here. Please give some extra info.

I have done some testing. It does work. I’m just finding a way so it does not loop.

so im trying to make a partyframe visible for all players so they can join a player’s party in a gamesmade section

game.ReplicatedStorage.Events.PartyShowing.OnClientEvent:Connect(function(partyowner, hardcore, Selected, level, DungeonName, GamesMade)
	print(level)
	local players = game.Players.LocalPlayer
	print(players)
	local partyowner = players.PlayerGui:WaitForChild("PlayGui").CreateFrame.PartyOwner
	local startergui = game:GetService("Players")
	print(partyowner.Value)
		if players.Data.Level.Value >= level then
		print("higher")
		newParty.Parent = startergui.PlayGui.GamesMade.Duplicates

i tried that to, but it didn’t work either

I’m testing it right now, and it is going to all the players in the server.

EDIT: Realized it did not work, and it would go to only 1 player. My bad.

Place the UI inside StarterGui then make sure you are using a local script to control the the UI. Server scripts don’t work for StarterGui unless you use remote events/functions.

The StarterGui automatically replicates the UI to every player.

im doing it on local, and im parenting it to the playergui. why isn’t it working?

Some one please correct me if I’m wrong but I have never heard of the PlayerGui only the StarterGui.
image

Use in ServerScriptService

game.Players.PlayerAdded:Connect(function(plr)
    local gui = (gui.path):Clone()
    gui.Parent = plr.PlayerGui
end)

Playergui inside the player, it’s a replica of startergui

PlayerGui is a folder inside Player, but in explorer say “StarterGui” like the “StarterPack” but in player is Backpack

Ah I understand what you mean now:
image

You can see on the developer hub it says use Clone. PlayerGui (roblox.com)

Instance Clone ( )
Create a copy of an object and all its descendants, ignoring objects that are not Archivable

Therefor I believe your code should be:

local players = game.Players.LocalPlayer
newParty.Parent = players.PlayerGui.PlayGui.GamesMade:Clone