I have been been messing around with Gui's and I went onto the wiki and followed a tutorial, the code works fine in studio but it' messes up online. I get the error saying "Avatar not a valid member of Frame(unitframe)" I'm not sure what the cause is .
and here is the code
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)
-- hierarchy
VStarterGui
VScreenGUI
VunitFrame
LocalScript
HealthBar
Avatar
playerName

2 comments
So are you sure all of the parents are in the correct places? Is avatar an image label or image button?
avatar is an image label and I believe everything is in the right place unless roblox wiki messed in someway.