BloXatoR

How to Make Chat Tag in Roblox Studios!

Jan 12th, 2024
3,352
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.56 KB | Gaming | 1 0
  1. --remodeled by @E4erZ
  2. --main holder @WheezWasTaken
  3.  
  4. --[[SETTINGS]]--
  5. local VIPGamepass=204960481
  6. local GroupID=15661208
  7. local OwnerTag={"Twitch_E4erZyt",""}
  8. local DeveloperTag={"",""}
  9. local AdminTag={"Not_E4erZ10",""}
  10. --[[]]--
  11. local function SetupTags()
  12.     spawn(function()
  13.         local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
  14.         local Tags = {
  15.             [1] = {
  16.                 -- Owner Checker
  17.                 ['CheckValidity']=function(Player)
  18.                     if not Player then return end
  19.                     if Player.ChatTagStorage:FindFirstChild("Owner") then
  20.                         return {
  21.                             --[[Chat Tag]]--
  22.                             {
  23.                                 TagText=[[👑 ]]..[[OWNER]],
  24.                                 TagColor=Color3.fromRGB(0, 255, 0) 
  25.                             },
  26.                             --[[PlayerName Colour]]
  27.                             Color3.fromRGB(0, 255, 0)
  28.                         }
  29.                     end
  30.                 end,
  31.             },
  32.             [2] = {
  33.                 -- Developer Checker
  34.                 ['CheckValidity']=function(Player)
  35.                     if not Player then return end
  36.                     if Player.ChatTagStorage:FindFirstChild("Developer") then
  37.                         return {
  38.                             --[[Chat Tag]]--
  39.                             {
  40.                                 TagText=[[🛠️ ]]..[[DEVELOPER]],
  41.                                 TagColor=Color3.fromRGB(0, 123, 255)   
  42.                             },
  43.                             --[[PlayerName Colour]]
  44.                             Color3.fromRGB(0, 170, 255)
  45.                         }
  46.                     end
  47.                 end,
  48.             },
  49.             [3] = {
  50.                 -- Admin Checker
  51.                 ['CheckValidity']=function(Player)
  52.                     if not Player then return end
  53.                     if Player.ChatTagStorage:FindFirstChild("Admin") then
  54.                         return {
  55.                             --[[Chat Tag]]--
  56.                             {
  57.                                 TagText=[[]]..[[ADMIN]],
  58.                                 TagColor=Color3.fromRGB(255, 0, 0) 
  59.                             },
  60.                             --[[PlayerName Colour]]
  61.                             Color3.fromRGB(255, 0, 0)
  62.                         }
  63.                     end
  64.                 end,
  65.             },
  66.             [4] = {
  67.                 -- VIP Checker
  68.                 ['CheckValidity']=function(Player)
  69.                     if not Player then return end
  70.                     if Player.ChatTagStorage:FindFirstChild("VIP") then
  71.                         return {
  72.                             --[[Chat Tag]]--
  73.                             {
  74.                                 TagText=[[]]..[[VIP]],
  75.                                 TagColor=Color3.fromRGB(243, 235, 8)   
  76.                             },
  77.                             --[[PlayerName Colour]]
  78.                             Color3.fromRGB(243, 235, 8)
  79.                         }
  80.                     end
  81.                 end,
  82.             },
  83.             [5] = {
  84.                 -- Group Checker
  85.                 ['CheckValidity']=function(Player)
  86.                     if not Player then return end
  87.                     if Player.ChatTagStorage:FindFirstChild("GroupMember") then
  88.                         return {
  89.                             --[[Chat Tag]]--
  90.                             {
  91.                                 TagText=[[💎 ]]..[[FAN]],
  92.                                 TagColor=Color3.fromRGB(0, 255, 204)   
  93.                             },
  94.                             --[[PlayerName Colour]]
  95.                             nil
  96.                         }
  97.                     end
  98.                 end,
  99.             },
  100.         }
  101.         ChatService.SpeakerAdded:Connect(function(PlayerName)
  102.             local speaker = ChatService:GetSpeaker(PlayerName)
  103.             local Player = game:GetService("Players")[PlayerName]
  104.             --[[]]--
  105.             local function UpdatePlayerTag()
  106.                 local TagData=nil
  107.                 local NameColourData=nil
  108.                 for i=1,#Tags do
  109.                     local Table=Tags[i]
  110.                     local Data=Table['CheckValidity'](Player)
  111.                     if Data then
  112.                         TagData=Data[1]
  113.                         NameColourData=Data[2]
  114.                         break
  115.                     end
  116.                 end
  117.                 --[[]]--
  118.                 if TagData then
  119.                     if NameColourData then
  120.                         speaker:SetExtraData("NameColor",
  121.                             NameColourData
  122.                         )
  123.                     end
  124.                     speaker:SetExtraData("Tags",{
  125.                         TagData
  126.                     })
  127.                 end
  128.             end
  129.             --[[]]--
  130.             local MessageCount=0
  131.             local UpdateEvery=2
  132.             Player.Chatted:Connect(function()
  133.                 if MessageCount>=UpdateEvery then MessageCount=0
  134.                     UpdatePlayerTag()
  135.                 elseif MessageCount==0 then UpdatePlayerTag()
  136.                 end
  137.                 MessageCount=MessageCount+1
  138.             end)
  139.             --[[]]--
  140.         end)
  141.     end)
  142. end
  143. game:GetService("Players").PlayerAdded:Connect(function(Player)
  144.     local ChatTagStorage=Instance.new("Folder")
  145.     ChatTagStorage.Name="ChatTagStorage"
  146.     ChatTagStorage.Parent=Player
  147.     local function Create(Name)
  148.         local Value=Instance.new("StringValue")
  149.         Value.Name=Name
  150.         Value.Parent=ChatTagStorage    
  151.     end
  152.     for i, v in pairs(OwnerTag) do
  153.         local lowerv=string.lower(v)
  154.         local loweru=string.lower(Player.Name)
  155.         if lowerv==loweru then
  156.             Create("Owner")
  157.             break
  158.         end
  159.     end
  160.     for i, v in pairs(DeveloperTag) do
  161.         local lowerv=string.lower(v)
  162.         local loweru=string.lower(Player.Name)
  163.         if lowerv==loweru then
  164.             Create("Developer")
  165.             break
  166.         end
  167.     end
  168.     for i, v in pairs(AdminTag) do
  169.         local lowerv=string.lower(v)
  170.         local loweru=string.lower(Player.Name)
  171.         if lowerv==loweru then
  172.             Create("Admin")
  173.             break
  174.         end
  175.     end
  176.     if VIPGamepass~=nil and game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player.UserId,VIPGamepass) then
  177.         Create("VIP")
  178.     end
  179.     if GroupID~=nil and Player:IsInGroup(GroupID) then
  180.         Create("GroupMember")
  181.     end
  182. end)
  183. SetupTags()
  184.  
  185. --Like and Subscribe For More!
  186.  
Advertisement
Add Comment
Please, Sign In to add comment