Getting player name from user id

Okay, so i had this hangout game idea where a random number is generated and set as a players character appearance id, and i easily made that work.
What i wanted to do next is tell the player who’s appearance they got by displaying the name of them on the bottom right with a GUI. This sounds so simple to make but i couldn’t really get it to work. I don’t know if it’s even possible to grab name from a random UserId. (character appearance id in this case) I’ve been looking at arguments that could get this to work but i couldn’t find one. I also couldn’t find any topics that answered my question.

simplified:
I’m trying to use a local script in a GUI to change a TextLabels text to the name of the current avatars owner.

6 Likes

I’m just gonna

Have you considered searching first? This returns a string value which would be the Player’s Name, provided that you have a Int64 value (Or UserId)

11 Likes

I’m pretty sure there’s a function for this? GetNameFromUserIdAsync I think it’s called

2 Likes

he’s asking to GET PLAYER NAME FROM USERID not GET USER ID FROM NAME

4 Likes

oh, i feel like an idiot now. I don’t know how i overlooked that one after searching for 15 mins straight. thanks.

1 Like

It happens :sweat_smile: Don’t worry about it, you’re all fine we all make simple mistakes like these from time to time

4 Likes