-- // FileName: GUICreatorV2.lua
-- // Written by: ManOfTrust32
-- // Description: Console SurfaceGUI creation script
game.Players.PlayerAdded:connect(function(player)
-- Sets player as GUI owner
local owner = SurfaceGUI.GUIOwner
owner.Value = player
-- Creates player avatars and their buttons
for x, player in pairs(game.Players:GetChildren()) do
if owner.Value == player then
return true
else
local avatar = game.ServerStorage["Player Avatar/Button"].PlayerAvatar:Clone()
avatar.Parent = SurfaceGUI.Main.ScrollingFrame
avatar.Name = player.Name
avatar.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=150&y=150&Format=Png&username="..player.Name
local button = game.ServerStorage["Player Avatar/Button"].PlayerButton:Clone()
button.Parent = SurfaceGUI.Main.ScrollingFrame
button.Name = player.Name.."'s Button"
button.Text = player.Name
end
end
Been thinking on this one and also tested what I have. First player join doesn't add the second player to their GUI yet second player obviously adds the first.

2 comments
Could you please post the code sample with the extra lines cut out? Just try to cut it down to the minimum example. Thanks!
Done