TagAPI:IsEquipped
The TagAPI:IsEquipped method checks whether a specific tag is currently equipped by a player. This differs from HasTag by verifying active equipment status rather than just ownership. Works in both server and client contexts.
Overview
Server, ClientbooleanSyntax
local isEquipped = TagAPI:IsEquipped(player: Player, tagId: string)
| Parameter | Type | Description |
|---|---|---|
player |
Player |
The player instance to check |
tagId |
string |
The tag identifier to check if equipped |
Return Values
| Return | Type | Description |
|---|---|---|
isEquipped |
boolean |
True if the player has the tag equipped, false otherwise |
Basic Usage
Check if a specific tag is equipped.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CCTFF = require(ReplicatedStorage:WaitForChild("CCTFF"))
local TagAPI = CCTFF.TagAPI
if TagAPI:IsEquipped(player, "VIP") then
print(player.Name .. " is showing their VIP tag")
else
print("VIP tag not equipped")
end
Active Bonus Check
Apply bonuses only when tag is actively equipped.
local function applyVIPBonus(player, rewardAmount)
local bonus = rewardAmount
-- Only apply bonus if VIP is equipped
if TagAPI:IsEquipped(player, "VIP") then
bonus = bonus * 2
print("VIP bonus applied!")
end
player.leaderstats.Coins.Value += bonus
return bonus
end
-- Award coins with potential VIP bonus
local coinsAwarded = applyVIPBonus(player, 100)
print("Awarded " .. coinsAwarded .. " coins")
Toggle Equipment
Toggle a tag's equipped state.
local function toggleTag(player, tagId)
if not TagAPI:HasTag(player, tagId) then
return false, "You don't own this tag"
end
if TagAPI:IsEquipped(player, tagId) then
TagAPI:Unequip(player, tagId)
return true, "Tag unequipped"
else
local success, message = TagAPI:Equip(player, tagId)
return success, message
end
end
local success, message = toggleTag(player, "Premium")
print(message)
UI Button State
Update UI button based on equipment status.
-- LocalScript
local player = game.Players.LocalPlayer
local TagAPI = CCTFF.TagAPI
local tagButton = script.Parent
local function updateButtonState(tagId)
if not TagAPI:HasTag(player, tagId) then
tagButton.Text = "๐ Locked"
tagButton.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
elseif TagAPI:IsEquipped(player, tagId) then
tagButton.Text = "โ Equipped"
tagButton.BackgroundColor3 = Color3.fromRGB(34, 197, 94)
else
tagButton.Text = "Equip"
tagButton.BackgroundColor3 = Color3.fromRGB(59, 130, 246)
end
end
-- Update on click
tagButton.MouseButton1Click:Connect(function()
toggleRemote:FireServer("VIP")
wait(0.1)
updateButtonState("VIP")
end)
updateButtonState("VIP")
Active Privileges
Grant access only when admin tag is equipped.
local function hasActiveAdminPrivileges(player)
local adminTags = {"Owner", "Admin", "Moderator"}
for _, tagId in ipairs(adminTags) do
if TagAPI:IsEquipped(player, tagId) then
return true, tagId
end
end
return false, nil
end
-- Command handler
local function executeAdminCommand(player, command)
local hasPrivileges, adminTag = hasActiveAdminPrivileges(player)
if not hasPrivileges then
return false, "Equip an admin tag to use commands"
end
print(player.Name .. " using " .. adminTag .. " executed: " .. command)
return true, "Command executed"
end
Chat Badge Display
Verify which tags should appear in chat.
local function getChatBadges(player)
local badges = {}
local possibleTags = {"Owner", "Admin", "Moderator", "VIP", "Premium"}
for _, tagId in ipairs(possibleTags) do
if TagAPI:IsEquipped(player, tagId) then
table.insert(badges, tagId)
end
end
return badges
end
-- Custom chat integration
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(message)
local badges = getChatBadges(player)
local badgeText = ""
for _, badge in ipairs(badges) do
badgeText = badgeText .. "[" .. badge .. "] "
end
print(badgeText .. player.Name .. ": " .. message)
end)
end)
Prevent Duplicate Equip
Check before attempting to equip.
local function safeEquip(player, tagId)
-- Check ownership first
if not TagAPI:HasTag(player, tagId) then
return false, "You don't own this tag"
end
-- Check if already equipped
if TagAPI:IsEquipped(player, tagId) then
return false, "Tag is already equipped"
end
-- Attempt to equip
return TagAPI:Equip(player, tagId)
end
local success, message = safeEquip(player, "VIP")
print(message)
Active Event Badge
Check if player is participating in an event via equipped tag.
local function isParticipatingInEvent(player, eventTag)
-- Must both own AND equip the event tag to participate
if not TagAPI:HasTag(player, eventTag) then
return false, "Don't have event tag"
end
if not TagAPI:IsEquipped(player, eventTag) then
return false, "Event tag not equipped"
end
return true, "Active participant"
end
-- Check when player tries to join event area
local participating, reason = isParticipatingInEvent(player, "SummerEvent2025")
if participating then
player:LoadCharacter() -- Teleport to event
else
print("Cannot join: " .. reason)
end
Equipped Tag Counter
Count how many tags from a list are equipped.
local function countEquippedFromList(player, tagList)
local count = 0
local equipped = {}
for _, tagId in ipairs(tagList) do
if TagAPI:IsEquipped(player, tagId) then
count += 1
table.insert(equipped, tagId)
end
end
return count, equipped
end
local premiumTags = {"VIP", "Premium", "Supporter"}
local count, equipped = countEquippedFromList(player, premiumTags)
print(player.Name .. " has " .. count .. " premium tags equipped")
print("Equipped: " .. table.concat(equipped, ", "))
Conditional Particle Effects
Apply visual effects based on equipped tags.
local function applyTagEffects(player)
local character = player.Character
if not character then return end
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if not humanoidRootPart then return end
-- Remove existing effects
for _, effect in ipairs(humanoidRootPart:GetChildren()) do
if effect:IsA("ParticleEmitter") then
effect:Destroy()
end
end
-- Add effects for equipped tags
if TagAPI:IsEquipped(player, "Legendary") then
local sparkles = Instance.new("Sparkles")
sparkles.Parent = humanoidRootPart
end
if TagAPI:IsEquipped(player, "VIP") then
local glow = Instance.new("PointLight")
glow.Color = Color3.fromRGB(255, 215, 0)
glow.Brightness = 2
glow.Range = 10
glow.Parent = humanoidRootPart
end
end
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
applyTagEffects(player)
end)
end)
-- Update when tags change
TagAPI.OnTagEquipped:Connect(applyTagEffects)
TagAPI.OnTagUnequipped:Connect(applyTagEffects)
Team Auto-Assignment
Assign teams based on equipped tags.
local function assignTeamByTag(player)
if TagAPI:IsEquipped(player, "Owner") or TagAPI:IsEquipped(player, "Admin") then
player.Team = game.Teams.Staff
elseif TagAPI:IsEquipped(player, "VIP") or TagAPI:IsEquipped(player, "Premium") then
player.Team = game.Teams.VIP
else
player.Team = game.Teams.Players
end
end
game.Players.PlayerAdded:Connect(assignTeamByTag)
-- Update team when tags are equipped/unequipped
TagAPI.OnTagEquipped:Connect(assignTeamByTag)
TagAPI.OnTagUnequipped:Connect(assignTeamByTag)
Rank Display
Show highest priority equipped tag as rank.
local TAG_PRIORITY = {
Owner = 1,
Admin = 2,
Moderator = 3,
VIP = 4,
Premium = 5,
Member = 6
}
local function getHighestEquippedRank(player)
local highestPriority = math.huge
local highestTag = "None"
for tagId, priority in pairs(TAG_PRIORITY) do
if TagAPI:IsEquipped(player, tagId) and priority < highestPriority then
highestPriority = priority
highestTag = tagId
end
end
return highestTag
end
-- Display rank in leaderstats
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local rank = Instance.new("StringValue")
rank.Name = "Rank"
rank.Value = getHighestEquippedRank(player)
rank.Parent = leaderstats
-- Update rank when tags change
TagAPI.OnTagEquipped:Connect(function(p)
if p == player then
rank.Value = getHighestEquippedRank(player)
end
end)
end)
Cooldown Reduction
Reduce ability cooldowns based on equipped tags.
local function getCooldownMultiplier(player)
local multiplier = 1.0
if TagAPI:IsEquipped(player, "Speedster") then
multiplier *= 0.8 -- 20% faster cooldowns
end
if TagAPI:IsEquipped(player, "Elite") then
multiplier *= 0.9 -- 10% faster cooldowns
end
if TagAPI:IsEquipped(player, "Premium") then
multiplier *= 0.95 -- 5% faster cooldowns
end
return multiplier
end
local function useAbility(player, baseCooldown)
local multiplier = getCooldownMultiplier(player)
local actualCooldown = baseCooldown * multiplier
print("Ability cooldown: " .. actualCooldown .. "s")
-- Apply ability logic here
return actualCooldown
end
useAbility(player, 10) -- 10 second base cooldown
Status Icon Display
Show overhead icons for equipped tags.
local TAG_ICONS = {
Owner = "๐",
Admin = "๐ก๏ธ",
VIP = "โญ",
Premium = "๐",
Developer = "๐ง"
}
local function updateOverheadIcon(player)
local character = player.Character
if not character then return end
local head = character:FindFirstChild("Head")
if not head then return end
-- Remove old icon
local oldGui = head:FindFirstChild("TagIcon")
if oldGui then oldGui:Destroy() end
-- Find highest priority equipped tag with icon
for tagId, icon in pairs(TAG_ICONS) do
if TagAPI:IsEquipped(player, tagId) then
local billboard = Instance.new("BillboardGui")
billboard.Name = "TagIcon"
billboard.Size = UDim2.new(0, 50, 0, 50)
billboard.StudsOffset = Vector3.new(0, 3, 0)
billboard.Parent = head
local label = Instance.new("TextLabel")
label.Size = UDim2.new(1, 0, 1, 0)
label.Text = icon
label.TextScaled = true
label.BackgroundTransparency = 1
label.Parent = billboard
break -- Only show highest priority
end
end
end
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
wait(0.5)
updateOverheadIcon(player)
end)
end)
TagAPI.OnTagEquipped:Connect(updateOverheadIcon)
TagAPI.OnTagUnequipped:Connect(updateOverheadIcon)
Achievement Unlock
Unlock achievements for equipping specific tag combinations.
local COMBO_ACHIEVEMENTS = {
TripleVIP = {"VIP", "Premium", "Supporter"},
AdminTrio = {"Owner", "Admin", "Moderator"},
EventCollector = {"SummerEvent", "WinterEvent", "HalloweenEvent"}
}
local function checkComboAchievements(player)
for achievementName, requiredTags in pairs(COMBO_ACHIEVEMENTS) do
local hasCombo = true
for _, tagId in ipairs(requiredTags) do
if not TagAPI:IsEquipped(player, tagId) then
hasCombo = false
break
end
end
if hasCombo and not TagAPI:HasTag(player, achievementName) then
TagAPI:Give(player, achievementName)
print(player.Name .. " unlocked: " .. achievementName)
end
end
end
TagAPI.OnTagEquipped:Connect(checkComboAchievements)
Access Level Calculation
Calculate numeric access level from equipped tags.
local ACCESS_LEVELS = {
Owner = 100,
Admin = 75,
Moderator = 50,
VIP = 25,
Premium = 10,
Member = 1
}
local function getAccessLevel(player)
local maxLevel = 0
for tagId, level in pairs(ACCESS_LEVELS) do
if TagAPI:IsEquipped(player, tagId) and level > maxLevel then
maxLevel = level
end
end
return maxLevel
end
local function canAccessArea(player, requiredLevel)
local playerLevel = getAccessLevel(player)
return playerLevel >= requiredLevel
end
-- Check access to restricted area
if canAccessArea(player, 50) then
print("Access granted")
else
print("Access denied - insufficient permissions")
end