So I've been learning from Roblox Wiki, and on one of the lessons is called "Making a Unit Frame" which shows you how to code it, but when I created it and joined my game, it doesn't show my username or my avatar, so I checked out the Developer Console and it says "Avatar not a valid member of frame" Here is the code I got from the Wiki:
local player = game.Players.LocalPlayer
local unitFrame = script.Parent
unitFrame.Avatar.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&username=" .. player.Name
unitFrame.PlayerName.Text = player.Name
local healthBar = unitFrame.HealthBarContainer.HealthBar
player.CharacterAdded:connect(function(character)
local humanoid = character:WaitForChild('Humanoid')
humanoid.HealthChanged:connect(function(health)
local healthPercentage = health / character.Humanoid.MaxHealth
healthBar.Size = UDim2.new(healthPercentage, 0, 1, 0)
end)
end)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
And here's the picture from the Explorer: http://prntscr.com/8ok1u9

3 comments
Sometimes I find it takes just a bit to load the assets of a GUI.
Have you tried replacing the line unitFrame.Avatar with unitFrame:WaitForChild("Avatar")?
It works! Thank you so much!