Advertisement
Cizzy

Untitled

Mar 13th, 2021
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. local function chatLogger(from, chat)
  2. if chat:match("^/w") ~= nil then
  3. to = chat:split(" ")[2]
  4. chat = chat:sub(("^/w "..chat:split(" ")[2]):len()+1)
  5. end
  6. if to == nil then
  7. print(from.Name .. ": " .. chat)
  8. else
  9. print(from.Name .. " --> " .. to .. ": " .. chat)
  10. end
  11. end
  12.  
  13. for _, v in pairs(game.Players:GetPlayers()) do
  14. v.Chatted:Connect(function©
  15. chatLogger(v, c)
  16. end)
  17. end
  18.  
  19. game.Players.PlayerAdded:Connect(function(plr)
  20. plr.Chatted:Connect(function©
  21. chatLogger(plr, c)
  22. end)
  23. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement