I would like to get my admin chat tag script working…
The issue is that it does not appear in the chat when I am trying it. I have tried changing lines and fixing the script for about an hour.
The chat tag should appear infront the name as “[ADMIN]”, but it does not seem to work.
local plrs = game.Players
local sss = game.ServerScriptService
local chatService = require(sss:WaitForChild('ChatServiceRunner'):WaitForChild('ChatService'))
chatService.SpeakerAdded:Connect(function(plr)
local speaker = chatService:GetSpeaker(plr)
if plr.UserId == 584039135 or plr.UserId == 1322163667 or plr.UserId == 361542322 then
speaker:SetExtraData('NameColor', Color3.fromRGB(255, 12, 203))
speaker:SetExtraData('ChatColor', Color3.fromRGB(255,220,0))
speaker:SetExtraData('Tags', {{TagText = 'ADMIN', TagColor = Color3.fromRGB(255,220,0)}})
print("Gave an admin special chat tag and chat color!")
end
end)
SpeakerAdded returns the name of the speaker, not the player instance, try this
local plrs = game.Players
local sss = game.ServerScriptService
local chatService = require(sss:WaitForChild('ChatServiceRunner'):WaitForChild('ChatService'))
chatService.SpeakerAdded:Connect(function(name)
local plr = plrs:FindFirstChild(name)
local speaker = chatService:GetSpeaker(plr)
if plr.UserId == 584039135 or plr.UserId == 1322163667 or plr.UserId == 361542322 then
speaker:SetExtraData('NameColor', Color3.fromRGB(255, 12, 203))
speaker:SetExtraData('ChatColor', Color3.fromRGB(255,220,0))
speaker:SetExtraData('Tags', {{TagText = 'ADMIN', TagColor = Color3.fromRGB(255,220,0)}})
print("Gave an admin special chat tag and chat color!")
end
end)
local plrs = game:GetService("Players")
local scriptservice = game:GetService("ServerScriptService")
local chatservice = require(scriptservice:WaitForChild("ChatServiceRunner",10):WaitForChild("ChatService",10))
local whitelist = {
584039135,
1322163667,
361542322
}
chatservice.SpeakerAdded:Connect(function(name)
local plr = plrs:FindFirstChild(name)
local id = plr.UserId
local speaker = chatservice:GetSpeaker(name)
if table.find(whitelist, id) then
speaker:SetExtraData('NameColor', Color3.fromRGB(255,12,203))
speaker:SetExtraData('ChatColor', Color3.fromRGB(255,220,0))
speaker:SetExtraData('Tags', {{TagText = 'ADMIN', TagColor = Color3.fromRGB(255,220,0)}})
print("Gave an admin special chat tag and chat color!")
end
end)
Also now I see the issue you were having before,
local speaker = chatService:GetSpeaker(plr)
This was being given a plr rather than the name, it was meant to be
Anytime! if you have anymore issues don’t be afraid to make another post! And I recommend using a whitelist via table like how I did, it’s more organized and doesn’t require a lengthy if statement!