K so bassicly I tried to make a script where when a player buys a gamepass then they get a rank in the roblox group.
I had my script like this:
game.Players.PlayerAdded:Connect(function(player)
if game.MarketplaceService:PlayerOwnsAsset(player,7719771) then
player:GetRoleInGroup
end
end)
I'm not sure if it is supposed to use the getroleingroup thing.

2 comments
Can you do the opposite though? Like if someone is a role in a group and they can get something in game?
Yes,https://developer.roblox.com/en-us/api-reference/function/Player/GetRoleInGroup