How to fix isfriendwith error

Hello Developers,

So I am making a custom leaderboard and I’ve made a textbutton for friending and unfriending so basically this is the script.

script.Parent.Parent.SelectedPlayer.Changed:Connect(function()
    if game.Players.LocalPlayer:IsFriendWith(game.Players:FindFirstChild(script.Parent.Parent.SelectedPlayer.Value).UserId) then
        script.Parent.Text = "-Unfriend"
    else
        script.Parent.Text = "+Friend"
    end
end)

So if the text is +friend then player sends friend request if not sends unfriend request.Now the script don’t work it says there is no isfriendwith arguement.

Can anyone fix this? if yes reply below

You forgot an “s” after the “Friend”, the correct method is IsFriendsWith()

2 Likes

Oh thanks alot! I thought it wont work

1 Like