Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- HOW TO MAKE FRIEND NOTIFIER ROBLOX STUDIO by BLOXIANCODE youtube.com/c/BloxianCode
- -- Tutorial: https://youtu.be/OERXc0-ETjc
- local Players = game:GetService("Players")
- local friendNotifier = game.ReplicatedStorage.FriendNotifier
- local function CheckFriends(otherPlayer, newPlayer)
- local succ, result = pcall(function()
- return otherPlayer:IsFriendsWith(newPlayer.UserId)
- end)
- return succ and result
- end
- local function notifyFriends(newPlayer)
- for _, otherPlayer in pairs(Players:GetPlayers()) do
- if otherPlayer ~= newPlayer and CheckFriends(newPlayer, otherPlayer) then
- friendNotifier:FireClient(otherPlayer, newPlayer)
- end
- end
- end
- game.Players.PlayerAdded:Connect(function(newPlayer)
- notifyFriends(newPlayer)
- end)
Advertisement
Add Comment
Please, Sign In to add comment