Advertisement
GemyScripter

Bubble Chat Script

Dec 26th, 2015
13,149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. -- Read the read me please. --
  2. local Color = "Blue"
  3.  
  4. function Chat(person,text)
  5. s = game:GetService("Players"):FindFirstChild(person.Name)
  6. if (s ~= nil) then
  7. if s.Character ~= nil then
  8. if s.Character.Head then
  9. game:GetService("Chat"):Chat(s.Character.Head, text, getColor())
  10. end
  11. end
  12. end
  13. end
  14.  
  15. function getColor()
  16. if Color == "Blue" or Color == "Enum.ChatColor.Blue" or Color == "Enum.DialogTone.Neutral" or Color == "Neutral" then
  17. return Enum.ChatColor.Blue
  18. elseif Color == "Green" or Color == "Enum.ChatColor.Green" or Color == "Enum.DialogTone.Friendly" or Color == "Friendly" then
  19. return Enum.ChatColor.Green
  20. elseif Color == "Red" or Color == "Enum.ChatColor.Red" or Color == "Enum.DialogTone.Enemy" or Color == "Enemy" then
  21. return Enum.ChatColor.Red
  22. else return Enum.ChatColor.Blue
  23. end
  24. end
  25.  
  26. function onChatted(msg, recipient, speaker)
  27. Chat(speaker,msg)
  28. end
  29.  
  30. function onPlayerEntered(newPlayer)
  31. newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
  32. end
  33.  
  34. game.Players.ChildAdded:connect(onPlayerEntered)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement