Hello!
I’m currently having multiple issues with the chat where the speaker doesn’t exist, the chat just doesn’t appear, it halts on ChatInstallVerifier, AddSpeaker doesn’t work, issues with basic functions like that.
Here’s the only script I have that references the chat and the chat still breaks with the script disabled:
local serverScriptService = game:GetService('ServerScriptService')
local replicatedStorage = game:GetService('ReplicatedStorage')
local players = game:GetService('Players')
local modules = replicatedStorage:WaitForChild('Modules')
local clientSidedAssets = replicatedStorage:WaitForChild('ClientSidedAssets')
local chatServiceRunner = serverScriptService:WaitForChild('ChatServiceRunner')
local chatService = require(chatServiceRunner:WaitForChild('ChatService'))
local permissionData = require(modules:WaitForChild('PermissionData'))
local nameColour = require(modules:WaitForChild('NameColour'))
local overhead = clientSidedAssets:WaitForChild('Overhead')
function setChatData(player, rankInfo)
local speaker = chatService:GetSpeaker(player.Name) or chatService:AddSpeaker(player.Name)
if rankInfo.OverrideExtraData then
if rankInfo.ChatInfo.GiveChatTag then
speaker:SetExtraData('Tags', {
{
['TagText'] = rankInfo.Text;
['TagColor'] = rankInfo.ChatInfo.NameColour or Color3.new(1,1,1);
}
})
end
speaker:SetExtraData('NameColor', rankInfo.ChatInfo.NameColour or Color3.new(1,1,1))
speaker:SetExtraData('ChatColor', rankInfo.ChatInfo.ChatColour or Color3.new(1,1,1))
else
local playerNameColour = nameColour:GetNameColour(player.Name)
local h, s, v = Color3.toHSV(playerNameColour)
local newChatColour = Color3.fromHSV(h, s - (s * 0.8), v)
print(newChatColour)
speaker:SetExtraData('ChatColor', newChatColour)
end
end
function createOverhead(player, rankInfo)
local character = player.Character or player.CharacterAdded:Wait()
local head = character:WaitForChild('Head')
local currentOverhead = overhead:Clone()
currentOverhead.Parent = head
for i,v in pairs(currentOverhead:GetChildren()) do
local frame = v:WaitForChild('Frame')
if rankInfo.CreateOverhead then
frame.PlayerRank.Text = '['..rankInfo.Text..']'
frame.PlayerRank.TextColor3 = rankInfo.ChatInfo.NameColour or Color3.fromRGB(255, 255, 255)
else
frame.PlayerRank:Destroy()
end
frame.PlayerName.Text = player.Name
frame.PlayerName.TextColor3 = rankInfo.ChatInfo.ChatColour or Color3.fromRGB(255, 255, 255)
v.Adornee = head
end
end
players.PlayerAdded:Connect(function(player)
local playerRank, rankInfo = permissionData:GetPlayerRank(player)
print(rankInfo)
setChatData(player, rankInfo)
local character = player.Character or player.CharacterAdded:Wait()
createOverhead(player, rankInfo)
player.CharacterAdded:Connect(function()
createOverhead(player, rankInfo)
end)
end)