So I was trying to make a group chat this where if your in the group you get a tag.
But theres 2 problems
1.If your not is the group then your tag is Guest but I want you to have no tag (Check By inserting into a game and chat you will see)
2.I want to change Tag Color and Chat color
local players = game:GetService(“Players”)
local serverScriptService = game:GetService(“ServerScriptService”)
local chatService = require(serverScriptService:WaitForChild(“ChatServiceRunner”):WaitForChild(“ChatService”))
chatService.SpeakerAdded:Connect(function(player)
local speaker = chatService:GetSpeaker(player)
players[player]:IsInGroup(9257320)
speaker:SetExtraData(“Tags”,{{TagText = players[player]:GetRoleInGroup(9257320)}})
end)
If you haven’t already I would strongly suggest thoroughly reading the documentation of the chat system to get a good understanding of how it works.
I wouldn’t suggest requiring the chat service like that I think what you should do is read over this part of the documentation then continue from there:
Here you go I just took what you made then remade it
local function Run(chatService)
local tagColor = Color3.fromRGB(255, 255, 255)
chatService.SpeakerAdded:Connect(function(speakerName)
local speaker = chatService:GetSpeaker(speakerName)
local player = chatService:GetPlayer()
if player and player:IsInGroup(9257320) then
speaker:SetExtraData(“Tags”,{{TagText = player:GetRoleInGroup(9257320), TagColor = tagColor}})
end)
end
end
return Run
(Put that code in a ModuleScript inside of the game.Chat.ChatModules folder)
I’m going to try it out for myself and see if I can figure out what the problem is. I’m still new to coding as I haven’t really been doing it for that long (only like a year or two).
My bad, it looks like I made a few mistakes that were making the code give errors. The code below should work as I actually verified it myself.
local function Run(chatService)
local tagColor = Color3.fromRGB(255, 255, 255)
chatService.SpeakerAdded:Connect(function(speakerName)
local speaker = chatService:GetSpeaker(speakerName)
local player = speaker:GetPlayer()
if player and player:IsInGroup(9257320) then
speaker:SetExtraData("Tags",{{TagText = player:GetRoleInGroup(9257320), TagColor = tagColor}})
end
end)
end
return Run
local function Run(chatService)
local tagColor = Color3.fromRGB(255, 255, 255)
local chatTextColor = Color3.fromRGB(255, 255, 255)
chatService.SpeakerAdded:Connect(function(speakerName)
local speaker = chatService:GetSpeaker(speakerName)
local player = speaker:GetPlayer()
if player and player:IsInGroup(9257320) then
speaker:SetExtraData("Tags",{{TagText = player:GetRoleInGroup(9257320), TagColor = tagColor}})
speaker:SetExtraData("ChatColor", chatTextColor)
end
end)
end
return Run
Then after you’re done doing that there should be a folder called ChatModules, go ahead and insert a module script into that. (Also the name of it doesn’t matter.)
Then once you’ve inserted it, open it up and replace what is inside of it with the code that I gave you. After that you should be done.
This just disabled chat. Could you link me the post I dont exactly know which ones to copy? The way I did it in my old game does not work in this game.
Did you disable Chat.LoadDefaultChat? If so that is probably why the chat isn’t appearing.
If it isn’t disabled then I don’t think I’m going to be able to help with that. I’m pretty certain the instructions that I gave should have worked and I can’t think of any other reason why they wouldn’t have. I tested those instructions in a newly loaded baseplate before I replied with them and I didn’t find any issues.