i want to make this so i don’t need to call the players but instead get the group rank 0-255
and if i can make this more compact that would be nice lol
yes i have looked at the Player | Roblox Creator Documentation and i don’t get how to do it still lol
local ServerScriptService = game:GetService("ServerScriptService")
local ChatService = require(ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
local Players = game:GetService("Players")
local Owner = {
["leadScientist"] = {"me"};
["coFounder"] = {"team"};
["test"] = {"Members"};
} -- Add roales and usernames
ChatService.SpeakerAdded:Connect(function(PlrName)
local Speaker = ChatService:GetSpeaker(PlrName)
for _, v in pairs(Owner.leadScientist) do
if Players[PlrName].Name == v then
Speaker:SetExtraData('Tags', {{TagText = "[lead scientist]", TagColor = Color3.fromRGB(255,0,0)}}) --Change the numbers to what you want the color to be, you get the color code from a part when you choose what color it should be.
end
end
for _, v in pairs(Owner.coFounder) do
if Players[PlrName].Name == v then
Speaker:SetExtraData('Tags', {{TagText = "[co-founder]", TagColor = Color3.fromRGB(46, 255, 0)}}) --Change the numbers to what you want the color to be, you get the color code from a part when you choose what color it should be.
end
end
for _, v in pairs(Owner.test) do
if Players[PlrName].Name == v then
Speaker:SetExtraData('Tags', {{TagText = "test", TagColor = Color3.fromRGB(0, 102, 255)}}) --Change the numbers to what you want the color to be, you get the color code from a part when you choose what color it should be.
end
end
end)
