So I am trying to change my chat font for my game and I made this but it doesn’t work, how would I fix it?
what I made:
local ServerScriptService = game:GetService("ServerScriptService")
local ChatService = require(ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
local Players = game:GetService("Players")
local spec = {'specowos'}
ChatService.SpeakerAdded:Connect(function(PlrName)
local Speaker = ChatService:GetSpeaker(PlrName)
for _, v in pairs(spec) do
if Players[PlrName].Name == v then
Speaker:SetExtraData('Font', {{Font = "Arcade"}})
end
end
end)
Ensure that SpeakerAdded is firing properly and that :GetSpeaker() is functioning as it should as well with print statements.
Looking at your code, it doesn’t look like a modulescript. However, in the chance that it is and you’re requiring it from the command bar or developer console, it won’t work.
local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")
local ChatServiceRunner = ServerScriptService:WaitForChild("ChatServiceRunner")
local ChatService = ChatServiceRunner:WaitForChild("ChatService")
local Chat = require(ChatService)
Chat.SpeakerAdded:Connect(function(SpeakerName)
local Speaker = Chat:GetSpeaker(SpeakerName)
local Player = Players:FindFirstChild(SpeakerName)
if Player.UserId == 346352186 then -- UserID for specowos
local Font = Enum.Font.Arcade
Speaker:SetExtraData("Font", Font)
end
end)