Advertisement
DrawingJhon

Bubble Chat (Filtered)

Jun 5th, 2021 (edited)
3,093
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. --Bubble chat filtered
  2.  
  3. local players = game:GetService("Players")
  4. local chat = game:GetService("Chat")
  5. local textService = game:GetService("TextService")
  6.  
  7. local function setup(plr)
  8.     plr.Chatted:Connect(function(message)
  9.         local head = plr.Character and plr.Character:findFirstChild("Head")
  10.         if head and head:IsA("BasePart") and head:IsDescendantOf(workspace) then
  11.             if message:sub(1,3) == "/e " or message:sub(1,3) == "/w " then
  12.             else
  13.                 local filter = textService:FilterStringAsync(message, plr.UserId):GetNonChatStringForBroadcastAsync()
  14.                 pcall(chat.Chat, chat, head, filter, "White")
  15.             end
  16.         end
  17.     end)
  18. end
  19.  
  20. for i, v in pairs(players:GetPlayers()) do
  21.     setup(v)
  22. end
  23. players.PlayerAdded:Connect(setup)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement