Advertisement
Guest User

CHATLOG

a guest
Nov 16th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. local log = function(plr,msg) --logging function
  2. print("<" .. plr.Name .. "> " .. msg)
  3. end
  4.  
  5. for _,plr in next,game.Players:GetChildren() do
  6. if plr:IsA("Player") then --connect all current players to logging function
  7. plr.Chatted:connect(function(msg) log(plr,msg) end)
  8. end
  9. end
  10.  
  11. game.Players.PlayerAdded:connect(function(plr)
  12. plr.Chatted:connect(function(msg) log(plr,msg) end) --connect all future joining players to logging function
  13. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement