Why won't this work?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    A leaderboard UI
  2. What is the issue? Include screenshots / videos if possible!
    Whywont this eow
    But it says “UI is not a member of playergui”
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried changing the code to waitforchild() but it didn’t work.
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local plr
local ID
game.Players.PlayerAdded(function(plr)
end
ID = plr.UserId 
local PlayerCharacter = GetPlayerByUserId(ID)
PlayerCharacter.PlayerGui.UI.Frame.Client1.TextLabel.Text = plr.Name

Why does it say a error of “UI is not a member of playergui”

Try using :WaitForChild("")

and PlayerGui is a child of Player not the Player’s Character


Ok, i’ll try it, i will ask you if it doesn’t work

do u only have this problem with the “UI” gui? the way u find the plr might be the problem . u can just do plr.PlayerGui