When I try to add the image, the image doesnt appear but it is getting created, here is my script:
game.Players.PlayerAdded:Connect(function(plr) local thumbType = Enum.ThumbnailType.HeadShot local thumbSize = Enum.ThumbnailSize.Size150x150 local playerThumbnail = game.Players:GetUserThumbnailAsync(plr.UserId, thumbType, thumbSize) local newImage = Instance.new("ImageLabel", game.StarterGui.Leaderboard.Frame) newImage.Name = plr.Name.."Image" newImage.Position = UDim2.new(0.5, 0, 0.5, 0) newImage.Size = UDim2.new(0, 150, 1, 0) newImage.AnchorPoint = Vector2.new(0.5, 0.5) newImage.Image = playerThumbnail end)
When you put things in StarterGui before clicking Play (With Player), it will immediately replicate to the PlayerGui. The PlayerGui is the reason the player sees the GUI to begin with. So instead of using the StarterGui, you need to put it in the PlayerGui.
game.Players.PlayerAdded:Connect(function(plr) local thumbType = Enum.ThumbnailType.HeadShot local thumbSize = Enum.ThumbnailSize.Size150x150 local playerThumbnail = game.Players:GetUserThumbnailAsync(plr.UserId, thumbType, thumbSize) local newImage = Instance.new("ImageLabel") newImage.Parent = plr.PlayerGui newImage.Name = plr.Name.."Image" newImage.Position = UDim2.new(0.5, 0, 0.5, 0) newImage.Size = UDim2.new(0, 150, 1, 0) newImage.AnchorPoint = Vector2.new(0.5, 0.5) newImage.Image = playerThumbnail end)