Hey I’m having an issue adding Imagine labels / text labels to a ScreenGui using a local script, The actual element will be in the explorer but is invisible in the GUI, when I replicate the same settings and explorer location it works fine so I don’t understand why its not working with the script. Here is the code I’m using:
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local playerPicture = Instance.new("ImageLabel")
local playerLabel = Instance.new("TextLabel")
playerPicture.ZIndex = 5
playerPicture.Image = Players:GetUserThumbnailAsync(player.UserId,Enum.ThumbnailType.HeadShot,Enum.ThumbnailSize.Size420x420)
playerPicture.BackgroundTransparency = 1
playerLabel.Text = player.Name
playerPicture.Parent = game.StarterGui.ScreenGui.BackgroundFrame.PlayerListFrame
playerLabel.Parent = game.StarterGui.ScreenGui.BackgroundFrame.PlayerListFrame
The end goal is to have the GUI generate the thumbnail and name of the local player onto the GUI but I am just focused on the picture atm.
Thanks
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local playerPicture = Instance.new("ImageLabel")
local playerLabel = Instance.new("TextLabel")
playerPicture.Size = UDim2.new(0, 420, 0, 420)
playerPicture.Position = UDim2.new(0, 10, 0, 10)
playerPicture.ZIndex = 5
playerPicture.Image = Players:GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
playerPicture.BackgroundTransparency = 1
playerLabel.Size = UDim2.new(0, 200, 0, 50)
playerLabel.Position = UDim2.new(0, 440, 0, 10)
playerLabel.Text = player.Name
playerLabel.TextColor3 = Color3.new(1, 1, 1)
playerLabel.TextSize = 30
playerLabel.BackgroundTransparency = 1
playerPicture.Parent = game.StarterGui.ScreenGui.BackgroundFrame.PlayerListFrame
playerLabel.Parent = game.StarterGui.ScreenGui.BackgroundFrame.PlayerListFrame
Try with that want to see if it gonna work with that.
Just gave it a shot, Didn’t seem to change anything. Nothing came up in the console either. Both elements were created as usual but remain invisible even though all the enabled / visible boxes are checked.
Here is a screenshot of the explorer if it helps(With the Image and text label from the script)