Ok so I got these chat tags scripts off a youtube tutorial but I don’t know how to make them work if you’re in a group

anyone know how?
Ok so I got these chat tags scripts off a youtube tutorial but I don’t know how to make them work if you’re in a group
You can use Player:IsInGroup(GroupId)
to see if they’re in a group.
In the CheckForTags
function, at the start you can add these lines:
for i,Player in pairs(game.Players:GetChildren()) do
if Player:IsInGroup(GroupId) then -- Replace with your group id
Tags[Player.Name] = {
["TagText"] = "Group Member"; -- Replace with your text
["TagColor"] = Color3.fromRGB(255,0,0) -- Replace with your color
}
end
end
This would add the tag in the module script table so the script can recieve it. It also loops through each player but you can get rid of the for i,Player in pairs(game.Players:GetChildren()) do
line if you don’t want to do this.
would it be like this?
That should be it. Does it work?
no I don’t think it’s working, lemme try again
yeah it doesn’t work
Next time use an Code Block this makes it much easyer for us to find the problem.
what is a code block? haven’t heard of that before
Press the </>
button at the top or use 3 backticks (`)
alright
local ServerScriptService = script.Parent
local ChatServiceRunner = ServerScriptService:WaitForChild("ChatServiceRunner")
local ChatService = require(ChatServiceRunner:WaitForChild("ChatService"))
local Tags = require(script.Tags)
local function CheckForTags(Player)
local Attempt = Tags[Player.UserId] or Tags[Player.Name]
if Attempt then
local SpeakerObject
repeat
wait()
SpeakerObject = ChatService:GetSpeaker(Player.Name)
until SpeakerObject ~= nil
SpeakerObject:SetExtraData("Tags", {Attempt})
else
print("No chat tags for "..Player.Name.."!")
end
end
game.Players.PlayerAdded:Connect(function(Player)
CheckForTags(Player)
end)
for _, Player in pairs(game.Players:GetPlayers()) do
CheckForTags(Player)
end
local module = {
["YT_Lemont"] = {
["TagText"] = "🔨";
["TagColor"] = Color3.fromRGB(255, 200, 0)
};
["Electroyzm"] = {
["TagText"] = "🔨";
["TagColor"] = Color3.fromRGB(255, 200, 0)
};
}
return module
That’s the old script, have you updated it with what I said before?
yeah I did, I just reverted to the old script to start from what it was before and work from there
Did this not work?
char limit
u can use GetRankInGroup too for the ranks feature
You can use this if you are not using group referral:
local players = game:GetService("Players")
local chatService = require(game.ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
local tags = {
[UserId] = {TagText = "The Tag Text", TagColor = Color3.fromRGB(255,255,0)},
--[UserId] = {TagText = "The Tag Text", TagColor = Color3.fromRGB(255,255,0)},
--You can add more by adding new lines
}
chatService.SpeakerAdded:Connect(function(playerName)
local speaker = chatService:GetSpeaker(playerName)
local player = game.Players[playerName]
if tags[player.UserId] then
speaker:SetExtraData("Tags",{tags[player.UserId]})
end
end)
yeah just tested again rn, definitely not working
Are there any errors in your console?