can any one help me please i cant fix this script its make a chat tag for the VIP gamepass and group members
CODE :
local gamepassId = 213679695
local service = game:GetService(“MarketplaceService”)
local rank = 100 – The rank the player will need to get through (out of 255)
local groupID = 7023447 – The group ID the player must be in
game.Players.PlayerAdded:Connect(function(player)
if player:IsInGroup(groupID) and player:GetRankInGroup(groupID) >= rank then
local tags = {
{
TagText = player:GetRoleInGroup(groupID),
TagColor = Color3.fromRGB(255, 172, 7)
}
}
local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner").ChatService)
local speaker = nil
while speaker == nil do
speaker = ChatService:GetSpeaker(player.Name)
if speaker ~= nil then break end
wait(0.01)
end
speaker:SetExtraData("Tags",tags)
speaker:SetExtraData("ChatColor",Color3.fromRGB(255, 172, 7))
else
if (service:UserOwnsGamePassAsync(player.UserId, gamepassId)) then
local tags = {
{
TagText = " VIP ",
TagColor = Color3.fromRGB(255, 172, 7)
}
}
local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner").ChatService)
local speaker = nil
while speaker == nil do
speaker = ChatService:GetSpeaker(player.Name)
if speaker ~= nil then break end
wait(0.01)
end
speaker:SetExtraData("Tags",tags)
speaker:SetExtraData("ChatColor",Color3.fromRGB(226, 226, 0))
end
end
end)