lets say i want to add friends that are friends with the user like this game here in a form of a npc. https://www.roblox.com/games/2142363973/T-Pose-Meme the game lists what i want, and it has that thing i said, im no good at explaining, how is that possible? does anybody know how it does that?
I'd recommend you utilize HTTPService and send GET /users/{userId}/friends request. (https://api.roblox.com/users/{userId}/friends) You should then randomly select a child from the decoded friend return.
1 | function print_random_friend() |
2 | plr = game.Players.LocalPlayer |
3 | friend_url = 'https://api.roblox.com/users/' ..plr.UserId.. '/friends' |
4 | local friends = game:GetService( "HttpService" ):GetAsync(friend_url) |
5 | math.randomseed(tick()) |
6 | ...Rest of the script... |