Hello, I am trying to add VIP to my chat tags. The original script was written by: Katrist
What I have tried.
I have tried using ChatGPT to make it, and… It didn’t work out
The Code it made
local Players = game:GetService("Players")
local TextChatService = game:GetService("TextChatService")
local groupId = # -- Replace with your group ID
local vipGamePassId = ### -- Replace with the VIP game pass ID
local vipTag = "<font color='#ffcc00'>[VIP]</font><font color='#b3b6b7'> "
local function hasChatTag(player)
return player.PlayerGui:FindFirstChild("Chat") and player.PlayerGui.Chat:FindFirstChild("Frame")
end
local function addChatTag(player, tag)
local props = Instance.new("TextChatMessageProperties")
props.PrefixText = tag .. "</font>"
return props
}
TextChatService.OnIncomingMessage = function(message: TextChatMessage)
local props = Instance.new("TextChatMessageProperties")
if message.TextSource then
local player = Players:GetPlayerByUserId(message.TextSource.UserId)
local hasVIPGamePass = player:HasPass(vipGamePassId)
if hasVIPGamePass and not hasChatTag(player) then
props = addChatTag(player, vipTag)
end
end
return props
end
(Do not use)
Current code:
-- Thank you too @Katrist for Writing the script
local Players = game:GetService("Players")
local TextChatService = game:GetService("TextChatService")
local groupId = ##### -- # Out Just Because
local tags = {
[255] = "<font color='#F5CD30'>[⚡God]</font><font color='#ff40ff'> ",
[254] = "<font color='#ff2600'>[🔨Developer]</font><font color='#2b83ff'> ",
[253] = "<font color='#ff2600'>[🔨Developer]</font><font color='#2b83ff'> ",
[214] = "<font color='#9c1df0'>[🛠️President]</font><font color='#b3b6b7'> ",
[212] = "<font color='#9c1df0'>[🛠️Head of Staff]</font><font color='#b3b6b7'> ",
[203] = "<font color='#2af0be'>[🌴Community manager]</font><font color='#2af0be'> ",
[202] = "<font color='#9b1df0'>[🛠️Admin]</font><font color='#b3b6b7'> ",
[200] = "<font color='#e1a9f5'>[🔧Moderator]</font><font color='#b3b6b7'> ",
[111] = "<font color='#83feec'>[🛠️Affiliate]</font><font color='#b3b6b7'> ",
[110] = "<font color='#ff8b07'>[🔥Partner]</font><font color='#ffd607'> ",
[101] = "<font color='#F5CD30'>[⭐️Supporter]</font><font color='#b3b6b7'> ",
[100] = "<font color='#63e848'>[✨Vip Dog]</font><font color='#b3b6b7'> ",
}
TextChatService.OnIncomingMessage = function(message: TextChatMessage)
local props = Instance.new("TextChatMessageProperties")
if message.TextSource then
local player = Players:GetPlayerByUserId(message.TextSource.UserId)
local rank = player:GetRankInGroup(groupId)
if tags[rank] then
props.PrefixText = tags[rank] .. message.PrefixText .."</font>"
end
end
return props
end
So basically what I’m trying to achieve is having a chat tag for VIP, that if somebody has a chat tag, it does not go over it, but if they don’t have a chat tag currently it show.
(Please let me know if that does not make sense)