How to send Friend Requests in-game?

Hey! What’s Up? So, umm :point_right: :point_left:. I was working on a new project and started on the leader board, and… I can’t figure out how to send a friend request in game
I have looked at other topics but after trying their solutions, it never worked.
To be more detailed here is my code

local fr = script.Parent.Friend
Frame = script.Parent
local open = false
local target = script.Parent.Player.Text
script.Parent.MouseButton1Click:Connect(function()
	if script.Parent.Player.Text == game.Players.LocalPlayer.Name then
		--return    Commented for testing
	end
	fr.Visible = true
	fr.Friend_BackGround.Visible = true
	fr:TweenPosition(UDim2.fromScale(-1,.5),"InOut","Quad",1)
	
end)
fr.MouseButton1Click:Connect(function()
	--This is where it will fire from
end)

If you could just point me in the right direction or to some helpful apis/topics, it would be a great help!

Also here is a topic that I looked at and it did not work: How to send in game friend requests

Have you tried the PromptSendFriendRequest part of the StarterGui:SetCore() function?

1 Like

Yes, And it did not, work but I figured out the problem, I was Submitting a string and not an object to send the request to.

Fair enough. Though you didn’t provide any direct code showing how you tried to approach this, so we couldn’t have helped you if that was the case.

1 Like