Social actions through custom leaderboard

I know this topic has been discussed before, but I need some help.

My UI has two buttons, one to send a friend request and one to block the user. Here’s what it looks like: https://gyazo.com/9876703df1be5bf6fb0f8bbf6da16bea

Now, for the friend request button, I want to change the text to “Unfriend Player” if the player has accepted the friend request. I’m using game.StarterGui:SetCore("PromptSendFriendRequest") to send the friend request, and I’m wondering if there is some function that runs if the player accepts/declines.

I’ve read a lot on the web about game.StarterGui:SetCore("PromptSendFriendRequest"), and either the info about what I’m looking for isn’t there, or I’m just not understanding it. If you guys know anything could you help me understand it?
Thanks, ok_wannabe :smile:

2 Likes

In the documentation for GetCore there are events for when a friend is added or removed.

There is no callback for PromptSendFriendRequest so you cannot directly check if the recipient accepted or denied a friend request.

You could look into PlayerFriendedEvent from GetCore here: StarterGui | Documentation - Roblox Creator Hub which is fired whenever a player is friended by the local player

Hmm…

for “PlayerFriendedEvent”, it says it returns a BindableEvent that is fired…

How do I use/access this BindableEvent?

You can use it like any bindable, (atleast i think)
i.e

game:GetService"StarterGui":GetCore"PlayerFriendedEvent".Event:Connect(function()
--code
end)
--untested

Thanks, I had no idea I could use something like this :grinning: