Basically I have made a local script where people are given either Devloper tag or VIP tag and it functions perfectly with print statments apart from the fact that people can not see other tags messages. Why is this? Any help?
local MarketPlaceService = game:GetService("MarketplaceService")
local Developers = {
"Being_Built",
"mabba6s_RENGANCE",
"Developer4Lifee"
}
textChatService.OnIncomingMessage = function(message: TextChatMessage)
local properties = Instance.new("TextChatMessageProperties")
if message.TextSource then
local player = game:GetService("Players"):GetPlayerByUserId(message.TextSource.UserId)
if table.find(Developers, player.Name) then
print(player.Name.."IS a developer")
properties.PrefixText = "<font color='#f74f25'>[Developer]</font> " .. "<font color='#ff8400'>🔨</font> " .. message.PrefixText
elseif MarketPlaceService:UserOwnsGamePassAsync(player.UserId, 672258353) then
properties.PrefixText = "<font color='#ffff00'>[👑 VIP]</font> "..message.PrefixText
print(player.Name.."OWNS VIP and is not a developer")
else
print(player.Name.."DOESNT OWN VIP OR IS A DEVELOPER SO DONT GIVE HIM THE CHAT TAG")
end
end
return properties
end
Where is this LocalScript placed? Your developer table should also be UserIds instead of names, so that even if one of the developers changes their name, their tag will still show.
I get an inifite yield on chatservice up top. Here is my server script:
local chatService = require(game.ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local tags = {}
local developer = {TagText = "[Developer]", TagColor = Color3.fromRGB(255, 0, 4)}
local VIP = {TagText = "[👑 VIP]", TagColor = Color3.fromRGB(255, 255, 30)}
local Developers = {
"3382361537",
"851194231",
"1423303857"
}
Players.PlayerAdded:Connect(function(player)
if player.UserId == table.find(Developers, player.UserId) then
table.insert(tags, player.UserId[developer])
print(player.Name.." Assigned Developer")
elseif MarketplaceService:UserOwnsGamePassAsync(player.UserId, 672258353) then
table.insert(tags, player.UserId[VIP])
end
end)
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)
and is there a function for chatservice to fire event every time someone speaks?
Oh, the guide didn’t mention this (because its from 2020) but that’s for the old chat system.
If you want to use the legacy chat version change the chatversion in TextChatService to LegacyChatService.
Here’s a guide for the newest chat system if you want to use that.