I'm working on chat tags, and got them working pretty well with badges. It would display everything correctly, but as soon as I start working with GetRankInGroup it starts bugging out. I've looked online a lot to find the issue but cant. Here's the script.
local ServerScriptService = game:GetService("ServerScriptService") local ChatService = require(ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService")) local Players = game:GetService("Players") local BadgeService = game:GetService("BadgeService") ChatService.SpeakerAdded:Connect(function(player) local Speaker = ChatService:GetSpeaker(player) if player:GetRankInGroup(5196996) == 254 then Speaker:SetExtraData('Tags', {{TagText = "Owner", TagColor = Color3.fromRGB(255, 0, 0) }}) elseif BadgeService:UserHasBadgeAsync(Players[player].UserId, 1397218698) then Speaker:SetExtraData('Tags', {{TagText = "Alpha", TagColor = Color3.fromRGB(239, 184, 56) }}) end end)
The error message seems to take me to line 09. Not sure whats up with that, but it worked fine before having the Owner rank.
Hello, yes i've checked your script twice and it's beacuse somehow it can't define the users, i've fixed it tho here ya go:
local ServerScriptService = game:GetService("ServerScriptService") local ChatService = require(ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService")) local Players = game:GetService("Players") local BadgeService = game:GetService("BadgeService") ChatService.SpeakerAdded:Connect(function(player) local Speaker = ChatService:GetSpeaker(player) if Players[player]:GetRankInGroup(5196996) == 254 then Speaker:SetExtraData('Tags', {{TagText = "Owner", TagColor = Color3.fromRGB(255, 0, 0) }}) elseif BadgeService:UserHasBadgeAsync(Players[player].UserId, 1397218698) then Speaker:SetExtraData('Tags', {{TagText = "Alpha", TagColor = Color3.fromRGB(239, 184, 56) }}) end end)
if it worked please accept, thank you