Tutorial for today is how to make 2+ variables in chat tag

i see theres so much developer who’s asking for this so i did this tutorial for them thats it Enjoy!! this tutorial

------------------------------SCRIPT

------------------THIS CHAT TAG WILL BE LOOK LIKE THIS [VIP][Guest]…Player.Name

local gamepass = 7016611
local mps = game:GetService(“MarketplaceService”)

------------------------------------------------ this is a normal chat tag

game.Players.PlayerAdded:Connect(function(player)
local tags = {
{
TagText = “Guest”,-- Text
TagColor = Color3.fromRGB(255, 255, 255)-- Text Color
}
}
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(‘NameColor’,Color3.fromRGB(255, 255, 255))
speaker:SetExtraData(“Tags”,tags)
speaker:SetExtraData(“ChatColor”,Color3.fromRGB(255, 255, 255))

------------------------------------------	if player owned gamepass

if mps:UserOwnsGamePassAsync(player.UserId,gamepass) == true or player.Name == "JOHN_REDGUY" then
	local tags = {
		{
			TagText = "VIP",-- text
			TagColor = Color3.fromRGB(255, 255, 0)--- text color
		},
		{
			TagText = "Guest",-- text
			TagColor = Color3.fromRGB(255, 255, 255)--- text color
		}
	}
	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('NameColor', Color3.fromRGB(255, 255, 255)) -- VIP NAME COLOR
	speaker:SetExtraData("Tags",tags)--VIP TagsColor
	speaker:SetExtraData("ChatColor",Color3.fromRGB(255, 255, 0)) -- VIP ChatColor
	end	

end)

------------------------------SCRIPT

ScreenShot of VIP Guest

that’s not only VIP Guest you can add VIP and Group

------------------------------VIP Group SCRIPT

------------------THIS CHAT TAG WILL BE LOOK LIKE THIS [VIP][Guest]…Player.Name

local gamepass = 7016611
local mps = game:GetService(“MarketplaceService”)

------------------------------------------------ this is a normal chat tag

game.Players.PlayerAdded:Connect(function(player)
local tags = {
{
TagText = “Guest”,-- Text
TagColor = Color3.fromRGB(255, 255, 255)-- Text Color
}
}
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(‘NameColor’,Color3.fromRGB(255, 255, 255))
speaker:SetExtraData(“Tags”,tags)
speaker:SetExtraData(“ChatColor”,Color3.fromRGB(255, 255, 255))

------------------------------------------	if player owned gamepass

if mps:UserOwnsGamePassAsync(player.UserId,gamepass) == true and player:IsInGroup(8042513) or player.Name == "JOHN_REDGUY" then
	local tags = {
		{
			TagText = "VIP",-- text
			TagColor = Color3.fromRGB(255, 255, 0)--- text color
		},
		{
			TagText = "Fan",-- text
			TagColor = Color3.fromRGB(255, 170, 0)--- text color
		}
	}
	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('NameColor', Color3.fromRGB(255, 255, 255))
	speaker:SetExtraData("Tags",tags)
	speaker:SetExtraData("ChatColor",Color3.fromRGB(255, 255, 0))
	end	

end)

------------------------------VIP Group SCRIPT

Screen Shot VIP Group

if you want chat tag only for group there it is

SCRIPT

local gamepass = 7016611
local mps = game:GetService(“MarketplaceService”)

------------------------------------------------ this is a normal chat tag

game.Players.PlayerAdded:Connect(function(player)
local tags = {
{
TagText = “Guest”,-- Text
TagColor = Color3.fromRGB(255, 255, 255)-- Text Color
}
}
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(‘NameColor’,Color3.fromRGB(255, 255, 255))
speaker:SetExtraData(“Tags”,tags)
speaker:SetExtraData(“ChatColor”,Color3.fromRGB(255, 255, 255))

------------------------------------------	if player owned gamepass

if player:IsInGroup(8042513) or player.Name == "JOHN_REDGUY" then
	local tags = {
		{
			TagText = "Fan",-- text
			TagColor = Color3.fromRGB(255, 170, 0)--- text color
		}
	}
	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('NameColor', Color3.fromRGB(255, 255, 255))
	speaker:SetExtraData("Tags",tags)
	speaker:SetExtraData("ChatColor",Color3.fromRGB(255, 255, 0))
	end	

end)

SCRIPT

so there we go thats it for today

ignore the auto jump i use that before because i experiment for premium xD

thanks for reading hope you learn something to my tutorial see ya on the next tutorial

1 Like

Hope it help you out my fellow Devs

Please format your code properly to avoid confusion.

4 Likes
------------------------------VIP Group SCRIPT

------------------THIS CHAT TAG WILL BE LOOK LIKE THIS [VIP][Guest]…Player.Name

local gamepass = 7016611
local mps = game:GetService(“MarketplaceService”)

------------------------------------------------ this is a normal chat tag

game.Players.PlayerAdded:Connect(function(player)
local tags = {
{
TagText = “Guest”,-- Text
TagColor = Color3.fromRGB(255, 255, 255)-- Text Color
}
}
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(‘NameColor’,Color3.fromRGB(255, 255, 255))
speaker:SetExtraData(“Tags”,tags)
speaker:SetExtraData(“ChatColor”,Color3.fromRGB(255, 255, 255))
------------------------------------------	if player owned gamepass

if mps:UserOwnsGamePassAsync(player.UserId,gamepass) == true and player:IsInGroup(8042513) or player.Name == "JOHN_REDGUY" then
	local tags = {
		{
			TagText = "VIP",-- text
			TagColor = Color3.fromRGB(255, 255, 0)--- text color
		},
		{
			TagText = "Fan",-- text
			TagColor = Color3.fromRGB(255, 170, 0)--- text color
		}
	}
	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('NameColor', Color3.fromRGB(255, 255, 255))
	speaker:SetExtraData("Tags",tags)
	speaker:SetExtraData("ChatColor",Color3.fromRGB(255, 255, 0))
	end	

end)
local gamepass = 7016611
local mps = game:GetService(“MarketplaceService”)

------------------------------------------------ this is a normal chat tag

game.Players.PlayerAdded:Connect(function(player)
local tags = {
{
TagText = “Guest”,-- Text
TagColor = Color3.fromRGB(255, 255, 255)-- Text Color
}
}
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(‘NameColor’,Color3.fromRGB(255, 255, 255))
speaker:SetExtraData(“Tags”,tags)
speaker:SetExtraData(“ChatColor”,Color3.fromRGB(255, 255, 255))

------------------------------------------	if player owned gamepass

if player:IsInGroup(8042513) or player.Name == "JOHN_REDGUY" then
	local tags = {
		{
			TagText = "Fan",-- text
			TagColor = Color3.fromRGB(255, 170, 0)--- text color
		}
	}
	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('NameColor', Color3.fromRGB(255, 255, 255))
	speaker:SetExtraData("Tags",tags)
	speaker:SetExtraData("ChatColor",Color3.fromRGB(255, 255, 0))
	end	
end)
1 Like

Several things I want to point out:

  • This isn’t a tutorial. This is just throwing code at users without any actual explanation.
  • Fix the formatting. Please.
  • Never use names to determine if someone should have a tag. Use UserIDs.
  • I see “Tags” and ‘NameColor.’ Those won’t form proper strings - only " and '.
  • Why the wait(0.01)? I don’t even think wait() can wait that little of a duration.
  • Indent your tables.
  • Lastly, you can condense much of this code into a function. That’d be a good idea.
4 Likes