I’m trying to make a VIP chat tag for my game. All VIPs in my game are friends with me. However, so are my admins. I want to give the VIP tag to the VIPs but make sure the admin tag does not get overridden. There are also specific VIPs who do not want the VIP tag, so they are also included.
I’ve been doing chat tags via Attributes. So, I want all the VIPs (who are not excluded or admin) to have the VIP attribute. Admins and excluded users should not have the VIP attribute.
I’ve tried looping through the list of admin user IDs but it just doesn’t work.
Here’s my code.
local ServerScriptService = game:GetService("ServerScriptService")
local Players = game:GetService("Players")
local admins = {1425735583,76819254,1165295122,104952955,3241852445}
local exclude = {989350009,4760223737}
Players.PlayerAdded:Connect(function(player)
if player:IsFriendsWith(1425735583) then
player:SetAttribute("VIP", true)
print("attribute given to user"..player.Name)
for index = 1, #admins do
player:SetAttribute("VIP", false)
print("attribute removed from user"..player.Name)
end
for index = 1, #exclude do
player:SetAttribute("VIP", false)
print("attribute removed from user"..player.Name)
end
end
end)
I work best with visual aids, so if you work with this code some, please post it. Thanks.