Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Read the read me please. --
- local Color = "Blue"
- function Chat(person,text)
- s = game:GetService("Players"):FindFirstChild(person.Name)
- if (s ~= nil) then
- if s.Character ~= nil then
- if s.Character.Head then
- game:GetService("Chat"):Chat(s.Character.Head, text, getColor())
- end
- end
- end
- end
- function getColor()
- if Color == "Blue" or Color == "Enum.ChatColor.Blue" or Color == "Enum.DialogTone.Neutral" or Color == "Neutral" then
- return Enum.ChatColor.Blue
- elseif Color == "Green" or Color == "Enum.ChatColor.Green" or Color == "Enum.DialogTone.Friendly" or Color == "Friendly" then
- return Enum.ChatColor.Green
- elseif Color == "Red" or Color == "Enum.ChatColor.Red" or Color == "Enum.DialogTone.Enemy" or Color == "Enemy" then
- return Enum.ChatColor.Red
- else return Enum.ChatColor.Blue
- end
- end
- function onChatted(msg, recipient, speaker)
- Chat(speaker,msg)
- end
- function onPlayerEntered(newPlayer)
- newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
- end
- game.Players.ChildAdded:connect(onPlayerEntered)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement