Advertisement
MaxproGlitcher

Script pour log les personne qui rejoint et quite le servers.lua

May 19th, 2024
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2.  
  3. local function sendMessage(message)
  4. game.ReplicatedStorage.DefaultChatSystemChatEvents.SayMessageRequest:FireServer(message, "All")
  5. end
  6.  
  7. Players.PlayerAdded:Connect(function(player)
  8. local playerName = player.Name
  9. local onlinePlayers = #Players:GetPlayers()
  10. local joinMessage = string.format("[✅] %s joined the server, now we have %d players online.", playerName, onlinePlayers)
  11.  
  12. sendMessage(joinMessage)
  13. end)
  14.  
  15. Players.PlayerRemoving:Connect(function(player)
  16. local playerName = player.Name
  17. local onlinePlayers = #Players:GetPlayers() - 1
  18. local leaveMessage = string.format("[📛] %s left the server, now we have %d players online.", playerName, onlinePlayers)
  19.  
  20. sendMessage(leaveMessage)
  21. end)
  22. --[[
  23.  
  24.  
  25.  
  26. pixel has had enough of this
  27. ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement