Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Chat = game:GetService("Chat")
- local plrs = game:GetService("Players")
- local serverScriptService = game:GetService("ServerScriptService")
- local chatServiceModule = require(serverScriptService:WaitForChild("ChatServiceRunner").ChatService)
- local ReplicatedModules = Chat:WaitForChild("ClientChatModules")
- local ChatModules = Chat:WaitForChild("ChatModules")
- local ChatConstants = require(ReplicatedModules:WaitForChild("ChatConstants"))
- local speaker = chatServiceModule:AddSpeaker("ROBLOX")
- local messages = {
- ", you are awesome!",
- ", you are special!",
- ", i like you",
- ", i like you the way you are"
- }
- speaker:JoinChannel("All")
- speaker:SetExtraData("NameColor", Color3.new(0, 132, 255))
- speaker:SayMessage("I am fake, sorry :(")
- speaker:SayMessage ("You can say: !message and i will send you a message :)")
- serverScriptService:WaitForChild("ChatServiceRunner").ChatService:Clone().Parent = workspace
- for i, v in pairs(chatServiceModule:GetChannelList()) do
- print(v)
- end
- local function GetWhisperChannelPrefix()
- if ChatConstants.WhisperChannelPrefix then
- return ChatConstants.WhisperChannelPrefix
- end
- return "To "
- end
- function GetWhisperChannelId(userName)
- return GetWhisperChannelPrefix() .. userName
- end
- local function plr_chatted(player, message)
- if string.lower(message) == "!message" then
- local number = table.getn(messages)
- local random = math.random(1, number)
- local channelObj = GetWhisperChannelId(player.Name)
- if channelObj == nil then warn("Erro: canal não encontrado!") return end
- speaker:JoinChannel(channelObj.Name)
- speaker:SayMessage(messages[random])
- end
- speaker:JoinChannel("All")
- end
- for i, player in pairs(plrs:GetPlayers()) do
- player.Chatted:Connect(function(message)
- plr_chatted(player, message)
- end)
- speaker:SayMessage("Hi "..player.Name.."!")
- end
- plrs.PlayerAdded:Connect(function(player)
- speaker:SayMessage("Hi "..player.Name.."!")
- end)
Advertisement
Add Comment
Please, Sign In to add comment