Why i cant clone gui into a player

why does it not clone?

ServerScriptService Script

for _, plr in pairs(Players:GetPlayers()) do
			if plr.InGame.Team.Value == "Team1" then
				local Team1 = script.Team1:Clone()
				Team1.Parent = plr.PlayerGui
			elseif plr.InGame.Team.Value == "Team2" then
				local Team2 = script.Team2:Clone()
				Team2.Parent = plr.PlayerGui
			end
		end

try
with RemoteEvents
playerGui Changes should be done in a localscript

1 Like

~ Any error ~
#################

Make sure there’s no error displayed and the gui is enabled

No, this should work just fine. There must be another issue with the script.

Try this

game.Players.PlayerAdded:Connect(function(plr)
    if plr.InGame.Team.Value == "Team1" then
        local Team1 = script:FindFirstChild("Team1"):Clone()
        Team1.Enabled = true
        Team1.Parent = plr:WaitForChild("PlayerGui")
    elseif plr.InGame.Team.Value == "Team2" then
        local Team2 = script:FindFirstChild("Team2"):Clone()
        Team2.Enabled = true
        Team2.Parent = plr:WaitForChild("PlayerGui")
    end
end)