Well, thanks for all the help. I’ll start working on the code rn.
Sorry, I’m not really sure what you mean. Do you mean you’re trying to make a VIP Pass, but you’re a developer, and the developer tag overwrittes/removes the VIP Tag?
Do you want 2 chat tags? If so, I’ll make the script for you.
I’m trying to create a VIP Pass, I have a Dev tag. I want to make a Vip tag, but the VIP one keeps overwriting/removing the Dev one.
Script 1:
game.Players.PlayerAdded:Connect(function(player)
if (service:UserOwnsGamePassAsync(player.UserId, gamepassId)) then
local tags = {
{
TagText = "📄Dev📄",
TagColor = Color3.fromRGB(0, 255, 255)
}
}
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(0, 255, 255))
end
end)```
Script Two:
local mps = game:GetService("MarketplaceService")
local gamepass = 19057556 -- Dev Gamepass ID
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
if mps:UserOwnsGamePassAsync(player.UserId,gamepass) == true then
game.ReplicatedStorage.NameTags:WaitForChild("📄Dev📄"):Clone().Parent = char.Head
end
end)
end)
Okay, do you want it so, when you own the dev gamepass, you will get a CHAT tag, but if you own both dev and VIP gamepass, it will show the 2 chat tags?
Yes, if that would be possible. I just don’t know how to do it.
local Tags = {
["Dev"] = {TagText = "📄Dev📄", TagColor = Color3.new(0, 255, 255)},
["VIP"] = {TagText = "VIP", TagColor = Color3.new(1, 1, 0)},
}
local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
ChatService.SpeakerAdded:Connect(function(player)
local speaker = ChatService:GetSpeaker(player)
local player = game.Players[player]
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.userId,17599737) then
speaker:SetExtraData("Tags",{Tags["VIP"]})
elseif game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.userId,19057556) and game:GetService("MarketplaceService"):UserOwnsGamePassAsync(17599737,player.userId) or player.Name == "StarTheRetroGuy" then
speaker:SetExtraData("Tags", Tags)
end
end)
Currently when I use the script I only see the VIP tag.
As other people mentioned, use if
, else
, and elseif
to run checks inside the same script.
The people that have provided example scripts include that, it works for them, but not for me.
Do you know why that happens? Are there any errors? Provide as much information as you can.
Sorry man! Works fine for me.
Did you make sure you copied my script exactly? Put it into serverscriptservice, and delete any other chat tag scripts.
This is the script I’m running, that @ImJaiz sent;
["Dev"] = {TagText = "Dev", TagColor = Color3.new(0, 255, 255)},
["VIP"] = {TagText = "VIP", TagColor = Color3.new(1, 0, 1)},
}
local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
ChatService.SpeakerAdded:Connect(function(player)
local speaker = ChatService:GetSpeaker(player)
local player = game.Players[player]
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.userId,17599737) then
speaker:SetExtraData("Tags",{Tags["VIP"]})
elseif game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.userId,19057556) and game:GetService("MarketplaceService"):UserOwnsGamePassAsync(17599737,player.userId) or player.Name == "StarTheRetroGuy" then
speaker:SetExtraData("Tags", Tags)
end
end)```
It is in ServerScriptService, no other Chat Tag scripts are in the game, just two for badges, one for player collision off, night cycle, and leaderboard group ranks.
Errors? I copied your script directly from what you posted.