Joriangames

Friend Notifier SCRIPT

Feb 8th, 2024
1,247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. -- HOW TO MAKE FRIEND NOTIFIER ROBLOX STUDIO by BLOXIANCODE youtube.com/c/BloxianCode
  2. -- Tutorial: https://youtu.be/OERXc0-ETjc
  3.  
  4. local Players = game:GetService("Players")
  5. local friendNotifier = game.ReplicatedStorage.FriendNotifier
  6.  
  7. local function CheckFriends(otherPlayer, newPlayer)
  8.     local succ, result = pcall(function()
  9.         return otherPlayer:IsFriendsWith(newPlayer.UserId)
  10.     end)
  11.     return succ and result
  12. end
  13.  
  14. local function notifyFriends(newPlayer)
  15.     for _, otherPlayer in pairs(Players:GetPlayers()) do
  16.         if otherPlayer ~= newPlayer and CheckFriends(newPlayer, otherPlayer) then
  17.             friendNotifier:FireClient(otherPlayer, newPlayer)
  18.         end
  19.     end
  20. end
  21.  
  22. game.Players.PlayerAdded:Connect(function(newPlayer)
  23.     notifyFriends(newPlayer)
  24. end)
Advertisement
Add Comment
Please, Sign In to add comment