Issue Description:
I am experiencing an issue with the UserTitle.Text field within my GUI does not update correctly when a new player joins the game. The script is supposed to update the text to reflect the player’s name and UserId, but the text remains unchanged.
Reproduction Steps
- Create a GUI with a UserTitle TextLabel inside a UserIDOverlayScreen Frame within the PlayerGui.
- Use a LocalScript that listens for the PlayerAdded event and updates the UserTitle.Text to display the player’s name and UserId.
- When a new player joins, the text does not update as expected.
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
local UserIDOverlayScreen = PlayerGui:WaitForChild("UserIDOverlayScreen")
local UserTitle = UserIDOverlayScreen:WaitForChild("UserTitle")
Players.PlayerAdded:Connect(function(player)
UserTitle.Text = player.Name .. " (" .. player.UserId .. ")"
end)
Expected Behavior
When a new player joins, I expect the UserTitle.Text to update with the player’s name and UserId, e.g., PlayerName (12345678)
Visual Aids: