Help with bubble chat script needed

I need some help with a bubble chat script.
I want to make the script a group rank. For example, if a player is in a group and have a rank then will have a bubble chat color.
Here is the script.

local roles = {}

function newRole(players, textcolor, bubblecolor, strokecolor, stroketransparency)
    local newRoleValue = {}
    newRoleValue.Players = players
    newRoleValue.BubbleColor = bubblecolor
    newRoleValue.TextColor = textcolor
    -- optional
    if strokecolor then newRoleValue.StrokeColor = strokecolor newRoleValue.StrokeTransparency = stroketransparency end
    table.insert(roles, #roles+1, newRoleValue)

newRole({"player1", "Player2"}, Color3.fromRGB(255,220,0), Color3.fromRGB(255,255,255), Color3.fromRGB(15,15,15), 0.5)

Does anyone know how to make the script works group rank? - Thanks