-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimple join and leave notification
41 lines (37 loc) · 1.06 KB
/
simple join and leave notification
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
local PlayerAdded = game.Players.PlayerAdded
local PlayerRemoved = game.Players.PlayerRemoving
local PlayerID = game.Players.LocalPlayer.UserId
local IsFriends = Player:IsFriendsWith(PlayerID)
local StarterGui = game.StarterGui
PlayerAdded:Connect(function(Player) -- Friend Joined
if IsFriends then
StarterGui:SetCore("SendNotification",{
Title = "Your Friend Has Joined The Game",
Text = Player.Name .. " joined.",
Duration = 5
})
end end)
PlayerRemoved:Connect(function(Player) -- Friend Left
if IsFriends then
StarterGui:SetCore("SendNotification",{
Title = "Your Friend Has Left The Game",
Text = Player.Name .. " left.",
Duration = 5
})
end end)
PlayerAdded:Connect(function(Player) -- Non-Friend Joined
if IsFriends then break else
StarterGui:SetCore("SendNotification",{
Title = "Has Joined The Game",
Text = Player.Name .. " joined.",
Duration = 5
})
end end)
PlayerRemoved:Connect(function(Player) -- Non-Friend Left
if IsFriends then break else
StarterGui:SetCore("SendNotification",{
Title = "Has Left The Game",
Text = Player.Name .. " left.",
Duration = 5
})
end end)