PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

IsFriendsWith

This function sends a request to the Roblox website asking whether a player is a friend of another user, given the Player/UserId of that user. This function caches results so multiple calls of the function on the same player with the same userId may not yield the most up-to-date result. This does not happen when used in a LocalScript.

Parameters

Name Type Default Description

The Player/UserId of the specified player.

Returns

Return Type Summary

A boolean indicating whether a player is a friend of the specified user.


Code Samples


How to Check if a Player is a Friend

The below example would print whether or not a recently added player is friends with Gordonrox24.

game.Players.PlayerAdded:Connect(function(player)
	if player:IsFriendsWith(146569) then
		print(player.Name .. " is friends with gordonrox24!")
	end
end)