So, this is basically a phone which allows you to message players. It always refreshes to check if a player is not displayed on the phone, but for some reason it keeps cloning even though a player’s name has already been cloned.
Local Script:
local function refresh()
for i, plr in pairs(game.Players:GetPlayers()) do
for i, v in pairs(script.Parent:GetChildren()) do
if v.Name == plr.Name then
return
else
local clone = script.Parent.Layout:Clone()
local players = game.Players
clone.Parent = script.Parent
clone.Name = plr.Name
clone.TextLabel.Text = plr.Name
clone.Visible = true
clone.ImageLabel.Image = players:GetUserThumbnailAsync(plr.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
end
end
end
end
while true do
wait(1)
refresh()
end