Inconsistent Player:IsFriendsWith() return

A few days ago my game has started having problems identifying who’s your friend in-game.

I periodically call Player:IsFriendsWith() on all players client-side to check the current friend status, and it seems like Player:IsFriendsWith() somehow returned false for a player who was my friend for the whole period:

This code snippet might roughly show what I’m doing:

local is_friends = nil
local success, result = pcall(function()
	is_friends = LocalPlayer:IsFriendsWith(tonumber(user_id_string))
end)
	
if success ~= true then
	warn("[FriendClient]: :IsFriendsWith() error:", result)
end
	
if success == true and type(is_friends) == "boolean" then
	if is_friends_server ~= is_friends then
		print(`[FriendClient]: Requesting server to switch friend state for {user_id_string} from "{is_friends_server}" to "{is_friends}"`)
		update_list[user_id_string] = is_friends
	end
end

The game this was captured in:

6 Likes

This is also happening for Chechos Deltarune RP - Roblox. Client side scripts cannot properly identify who your friends are and it’s leading to friends being unable to TP to eachother

Hello!
This was related to a change we made on how we check who your friends are using IsFriendsWith. We had only rolled it out to desktop clients which explains why you only saw it locally. We rolled it back.

please let us know if you see any issues.

1 Like

Hi! I’ve begun seeing this same issue - Specifically, this function will often only ever return true for one friend in a server even if multiple are present.

2 Likes

Experiencing this problem as well. Any updates on this? Getting a lot of inconsistencies with the results.

1 Like

Hey howdy, hope you’re doing well amigo.

Just updating this thread - I’m also currently experiencing this issue. A friend and I were trying to test this in-game today and :IsFriendWith was regularly returning false on us even though we were friends.

1 Like

Hmm, i’ll check if something changed since fixing this.

Thanks for the reports

I’d like to +1 this. I get inconsistent returns, where sometimes the check works fine, and others it returns false (even though we are friends).

The ‘PlayerFriendedEvent’ fires on start and seems to fire correctly, so there are hacky solutions around this, but ‘PlayerFriendedEvent’ fires on join, even though the docs imply it should only fire if two users become friends while in-game.

Hey all I cant immediately repro calling IsFriendsWith when people join it all looks accurate to me. Do any of you have code samples or repro steps where you saw it sometimes returning false?

The code below is super inconsistent for me when I play with multiple players who are all friends. Some get isFriendsWith = true and some false when all should be true. Sometimes it works fine though.

local serverFriends = {}

Players.PlayerAdded:Connect(function(player)
	if RunService:IsClient() then	
		if player == game.Players.LocalPlayer then return end

		local isFriendsWith = player:IsFriendsWith(game.Players.LocalPlayer.UserId)

		if isFriendsWith then
			table.insert(serverFriends[game.Players.LocalPlayer], player)
		end
	end
end)
2 Likes

This is very broken in our new game.

You can see it returns true/false for the SAME user (this is called from a Client)

ChatGPT knew it was broken and sent me to this thread :sweat_smile:

4 Likes

Hello!

Took some time to look into this and am working on a fix. I’ll update here once its out to verify everything seems to be working!

Thanks for the reports!

1 Like

Rolled out a fix today that should reduce the issues you all have been seeing. Let me know if its still happening!

1 Like

I’m still getting the issue. It’s crazy to think it happened right after I made a feature in my game that requires this call to work. Although, it is calling it for UserIds that aren’t in the game. Not sure if that’s not intended, but otherwise I still need a method for this.

The changed i made definitely benefits users that are in game more than outside. I can look at fixing checking friends out of game as a follow up. Can you explain your feature more so I better understand the use case. Feel free to dm me if thats better.

I sent you a message on my use case a while ago. Any new status on it?