Frame not clonning

game.ReplicatedStorage.MatchEnd.OnClientEvent:Connect(function()
	wait(0.1)
	game.Players.LocalPlayer.PlayerGui["Match End"].Enabled = true
	
	local Ypos = 0.25
	for i,v in pairs(game.Teams["Bright blue Team"]:GetPlayers()) do
		local a = Instance.new("TextLabel")
		a.Text = "lol"
		a.Position = UDim2.new(0.025,0,Ypos,0)

		
		
		local Gui = game.Players.LocalPlayer.PlayerGui["Match End"].Frame.Left.Sample:Clone()
		Gui.LeftMate1.Text = game.Players.LocalPlayer.Name
		Gui.Visible = true
			
		Gui.Position = UDim2.new(0.025,0,Ypos,0)
		
		Ypos = Ypos + 0.15
	end
end)

This is my code, I’m trying to create a match statistics board at the end of the game but the frame won’t clone which is what I need it to do so I can put other players scores on there.

It seems like you are not setting their parents (they should be set to something in the playergui) , this would cause them not to show up in your game.

How do you set parent in the playergui

This can be achieved by doing something like this:

(Note that setting the gui to the playergui directly will not show up on the screen, you have to place it in a screen gui to show up)

local Playergui = game.players.Localplayer:WaitforChild("PlayerGui").(screen gui that is already in the playergui goes here)

(Gui goes here).Parent = PlayerGui

also when Instancing a object, you can include the parent in the second parameter

1 Like