I need something for a script to get the userid of one of the player’s friends via a local script. This isn’t a full script I’m asking for, I need help with this one element for a different script. I’ve tried GetFriendsAsync but, I don’t really understand it. Could anyone offer any help?
1 Like
If you just want the userid of one of the friends of the player, you can use this. It gives you the UserId of the first friend on the list.
local players = game:GetService("Players")
local player = -- the player whose friend's UserId you want
local friendUserId = Players:GetFriendsAsync(player.UserId):GetCurrentPage()[1].UserId
1 Like