Hey, guys. So I've been working on this Gui that shows the player's avatar picture when they join the game by finding their userId. It works great; but that's not the problem.
You see, when I played as a Guest, I noticed that there was no avatar picture - it was just a picture with an X. This means that Guests do not have userIds correct?
I'm not so sure, but I made a TextLabel that had the word"Guest" on it appear whenever the userId of the player couldn't be found; but it's not working...
This is the script inside the TextLabel (It is a localscript):
local button = script.Parent
local userid = script.Parent.Parent.Parent.Parent.Parent.userId -- (The parenting here is correct!)
if userid == nil then
button.Visible = true
end
I think I'm trying to veer into a completely different direction, but could anyone please explain to me how to accomplish this? THANKS!

4 comments
Thanks so much!
No problem, glad to help! :D
I recommend just using the ID, since a player can name themselves "Guest" and not actually be a guest.
That is why I added a space ' ' to the 'Guest' string, every 'Guest' has the name 'Guest ', then the random number, there is a space between the Name and Number [E.xx; 'Guest' '1337'], and, in the code, it is doing just that. @Aquathorn321