Requiring chatservice
So the first step to using the epic feature of the magic chat service, you need to do a thing called require.
I'm assuming you know what is require, if not: http://wiki.roblox.com/index.php?title=Global_namespace/Functions_specific_to_ROBLOX#require
So the chatservice is not a service (haha), and it is deeply hidden in the game.
local chat = require(game.ServerScriptService.ChatServiceRunner.ChatService)
AddSpeaker and GetSpeaker
These both functions are great!
So, AddSpeaker just adds a fake player onto the chat which can chat!
Here's an example:
local chat = require(game.ServerScriptService.ChatServiceRunner.ChatService)
local speaker = chat:AddSpeaker("Bob")
speaker:JoinChannel("All")
speaker:SayMessage("Hey, my name is Bob!", "All")
Trying to add an existing speaker will result in an error.
So here comes: GetSpeaker!
It just tries to find a real player which can speak or a fake player in the chat.
Usage: chat:GetSpeaker("Speaker Name")
Once we get a speaker, we can change his Font, ChatColor and others!
Fonts, ChatColor, NameColor, etc.
This is the fun part.
Not only you can make your text almost unreadable, but you can fake John Doe and make his chat pink!
The full list is: Font, NameColor, ChatColor, TextSize
Remember, always set those properties with SetExtraData
So, let's get John Doe and do some silly stuff to him!
local chat = require(game.ServerScriptService.ChatServiceRunner.ChatService)
local speaker = chat:GetSpeaker("John Doe")
speaker:SetExtraData('Font', "Arcade")
speaker:SetExtraData('NameColor', Color3.fromRGB(255, 255, 255))
speaker:SetExtraData('ChatColor', Color3.fromRGB(255,105,180))
speaker:SetExtraData('TextSize', 70)
1 comment
wow.