Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local function sendMessage(message)
- game.ReplicatedStorage.DefaultChatSystemChatEvents.SayMessageRequest:FireServer(message, "All")
- end
- Players.PlayerAdded:Connect(function(player)
- local playerName = player.Name
- local onlinePlayers = #Players:GetPlayers()
- local joinMessage = string.format("[✅] %s joined the server, now we have %d players online.", playerName, onlinePlayers)
- sendMessage(joinMessage)
- end)
- Players.PlayerRemoving:Connect(function(player)
- local playerName = player.Name
- local onlinePlayers = #Players:GetPlayers() - 1
- local leaveMessage = string.format("[📛] %s left the server, now we have %d players online.", playerName, onlinePlayers)
- sendMessage(leaveMessage)
- end)
- --[[
- pixel has had enough of this
- ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement