I have a custom leaderboard and I want people to be able to make friends in my game.
[code]Function void Player:PromptSendFriendRequest(Player receivingPlayer)
Function void Player:PromptReceiveFriendRequest(Player sendingPlayer)
Function FriendRequestStatus Player:GetFriendRequestStatus(Player otherPlayer)
Function void Player:PromptFollow(Player otherPlayer)
Event Player.FriendRequestStatusChanged(Player otherPlayer, FriendRequestStatus status)
Enum FriendRequestStatus
0 NoPendingRequest
1 SentPending
2 ReceivedPending
3 PlayersAreFriends[/code]
PromptSendFriendRequest would prompt the Player to send a friend request to receivingPlayer through a core gui, where they have the option to either send the friend request or to cancel.
PromptReceiveFriendRequest would prompt the Player to either accept or decline someone else’s friend request.
GetFriendRequestStatus tells you the status of a friend request to a specific player. If there is no pending friend request then it will return NoPendingRequest, if there is a pending request sent by Player it will return SentPending, if there is a pending request sent by otherPlayer it will return ReceivedPending, if the players are already friends it will return PlayersAreFriends.
PromptFollow would prompt the Player to follow otherPlayer with a core gui the same way PromptSendFriendRequest works.
FriendRequestStatusChanged will fire whenever the Player receives a friend request, sends a friend request, accepts a friend request, or declines a friend request. It will return the other player involved in the action and the corresponding FriendRequestStatus.
The idea is that you would have player1 click a button on your custom leaderboard to send a friend request to another player. You would call PromptSendFriendRequest on player1 for player2 and player1 would confirm that they want to send a friend request. Then FriendRequestStatusChanged will fire for both players. A script would listen for that and call PromptReceiveFriendRequest on player2 and then they would either accept or decline the request.