I have a script which gives a player a chattag if they are a certain role in my group, However it has given me all the roles?
Is it because i’m the owner?
local plrs = game.Players
local sss = game.ServerScriptService
local chatService = require(sss:WaitForChild('ChatServiceRunner'):WaitForChild('ChatService'))
local groupID = 5336178
chatService.SpeakerAdded:Connect(function(plr)
local speaker = chatService:GetSpeaker(plr)
-- COPY FROM THIS
repeat wait() until
plrs[plr].leaderstats:WaitForChild("ChatValues").Owner.Value == true
if plrs[plr].leaderstats:WaitForChild("ChatValues").Owner.Value == true then
speaker:SetExtraData('NameColor', Color3.fromRGB(85, 0, 255))
speaker:SetExtraData('ChatColor', Color3.fromRGB(255, 255, 255))
speaker:SetExtraData('Tags', {{TagText = 'Owner', TagColor = Color3.fromRGB(85, 255, 127)}})
print("Gave the owner a special chat tag and chat color!")
end
local RankCheck = plrs[plr]:GetRankInGroup(groupID)
local GroupTagCheck = RankCheck
if plrs[plr]:GetRankInGroup(253) then
plrs[plr].leaderstats:WaitForChild("ChatValues").Staff.Value = true
end
repeat wait() until
plrs[plr]:GetRankInGroup(253) and plrs[plr].leaderstats:WaitForChild("ChatValues").Staff.Value == true
if plrs[plr]:GetRankInGroup(253) and plrs[plr].leaderstats:WaitForChild("ChatValues").Staff.Value == true then
speaker:SetExtraData('Tags', {{TagText = 'Server Booster', TagColor = Color3.fromRGB(255, 85, 255)}})
print("Gave the Staff Member a special chat tag and chat color!")
end
if plrs[plr]:GetRankInGroup(4) then
plrs[plr].leaderstats:WaitForChild("ChatValues").Contributor.Value = true
end
repeat wait() until
plrs[plr]:GetRankInGroup(4) and plrs[plr].leaderstats:WaitForChild("ChatValues").Contributor.Value == true
if plrs[plr]:GetRankInGroup(4) and plrs[plr].leaderstats:WaitForChild("ChatValues").Contributor.Value == true then
speaker:SetExtraData('Tags', {{TagText = 'Contributor', TagColor = Color3.fromRGB(85, 255, 255)}})
print("Gave the Contributor a special chat tag and chat color!")
end
end)
Help would be appreciated thank you.