What do you want to achieve?
I want to update a text label in to display the username of the match host followed by “'s Lobby.”
What is the issue?
The text label (Lobby.HostText.Text) is being updated to “Roblox’s lobby” instead of the expected result (HostName .. "'s Lobby") so xProlific's Lobby even though Players:GetNameFromUserIdAsync(MatchHost) is returning the correct username, and the HostName variable is printing my name correctly. There is no other external scripts or any other lines of code that change the Text of the Header
What solutions have you tried so far?
I have checked the initial value of Lobby.HostText.Text and confirmed that it’s not set to “Roblox’s lobby.” I’ve also added debugging print statements to verify the values of HostName. (They are all correct)
local HostName = Players:GetNameFromUserIdAsync(MatchHost)
local LobbyText = HostName .. "'s Lobby"
print(LobbyText)
Lobby.HostText.Text = LobbyText
Lobby.Name = LobbyText
By storing the concatenated text in a separate variable (LobbyText ), you can both print it for debugging purposes and set the Lobby.HostText.Text property with the expected value.
It’s possible that the Lobby.HostText element isn’t being properly updated. Try this:
Verify that Lobby.HostText is indeed the correct text label element that you want to update. Make sure there are no other elements with similar names or that the element hasn’t been reset elsewhere in the code.
Ensure that Lobby.Name refers to the parent of Lobby.HostText and not another object. It should be the parent frame or object where you want to set the new text.
Verify that Lobby.HostText is indeed the correct text label element that you want to update. Make sure there are no other elements with similar names or that the element hasn’t been reset elsewhere in the code.
Yup I’ve verified it is indeed the correct text label element that I want to update. (I’ve checked the entire code multiple times)
Ensure that Lobby.Name refers to the parent of Lobby.HostText and not another object. It should be the parent frame or object where you want to set the new text.
Yes, “Lobby” is indeed the parent frame.
Output (I have added a second print statement for the text, and the lobby path too) :