Scripting help!

How do I make it so if a client’s friend is in the game with said client, how would I make a print function?

Ok let me explain it another way. If you have a friend online in the same server with you, you would get a boost of coins, for example, Pet ranch simulator 2 and Texting simulator.

1 Like

You can use Player:IsFriendsWith connected to a PlayerAdded function.

LocalScript:

game.Players.PlayerAdded:Connect(function(player)
     if game.Players.LocalPlayer:IsFriendsWith(player.UserId) then
          print("My friend", player, "just joined!")
     end
end)
3 Likes