Advertisement
EconomicSerg

GamePass Chat Tag

Mar 9th, 2021
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.04 KB | None | 0 0
  1. -- Add a Script into the Workspace
  2.  
  3. local id = "" -- Set this to your gamepass id
  4. local mps = game:GetService("MarketplaceService") -- The service
  5.  
  6. game.Players.PlayerAdded:Connect(function(player)
  7.         if (mps:UserOwnsGamePassAsync(player.UserId, id)) then
  8.             local tags = {
  9.                 {
  10.                     TagText = "VIP", -- Change this to the name of the gamepass like Premium or something
  11.                     TagColor = Color3.new(255, 255, 0) -- Tag Color
  12.                 }
  13.             }
  14.            
  15.             local ChatService = require(game.ServerScriptService:WaitForChild("ChatServiceRunner").ChatService)
  16.             local speaker = nil
  17.            
  18.             while speaker == nil do
  19.                 speaker = ChatService:GetSpeaker(player.Name)
  20.                 if speaker ~= nil then break end
  21.                 wait(0.01)
  22.             end
  23.             speaker:SetExtraData("Tags", tags) -- Sets the tag
  24.             speaker:SetExtraData("ChatColor", Color3.new(255, 255, 0)) -- Chat Color
  25.         end
  26. end)        
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement