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
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.
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.
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.
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)
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.