TagAPI:ClearAll
The TagAPI:ClearAll method removes all owned and equipped tags from the player and resets all tag-related states. Useful for account resets, punishment commands, or game re-roll features. It is generally a server-side API call and should be executed with caution, as it wipes all tag progress for the player.
Overview
Execution Context
ServerScript Type
Server Script
Returns
booleanSide Effects
Clears all tag data for the player
Syntax
local success = TagAPI:ClearAll(player: Player)
| Parameter | Type | Description |
|---|---|---|
player |
Player |
The player whose tags should be cleared |
Return Values
| Return | Type | Description |
|---|---|---|
success |
boolean |
True if tags were cleared, false otherwise |
Basic Usage
Clear all tags for a player.
Lua
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CCTFF = require(ReplicatedStorage:WaitForChild("CCTFF"))
local TagAPI = CCTFF.TagAPI
local success = TagAPI:ClearAll(player)
if success then
print("All tags cleared from " .. player.Name)
else
print("Error clearing tags")
end
Account Reset Command
Admin command for full player tag reset.
Lua
local function resetPlayerTags(admin, args)
local targetName = args[1]
local targetPlayer = game.Players:FindFirstChild(targetName)
if not targetPlayer then
return false, "Player not found"
end
local success = TagAPI:ClearAll(targetPlayer)
if success then
return true, "Tags reset for " .. targetPlayer.Name
else
return false, "Failed to reset tags"
end
end
adminCommands["cleartags"] = resetPlayerTags
Punishment System
Remove all tags from a player as a penalty.
Lua
local function punishPlayer(player)
local success = TagAPI:ClearAll(player)
if success then
print("Player punished by clearing all tags")
end
end
-- Usage: punishPlayer(targetPlayer)
Reroll System
Clear all tags before reassigning a new random set.
Lua
local function rerollTags(player)
if TagAPI:ClearAll(player) then
TagAPI:Give(player, "Starter")
TagAPI:Equip(player, "Starter")
print("Player given new starter tags after reroll.")
end
end
-- Usage: rerollTags(targetPlayer)
Leaderboard Update
Update leaderboards after clearing tags.
Lua
game.Players.PlayerRemoving:Connect(function(player)
local success = TagAPI:ClearAll(player)
if success then
print("Cleared tags before removing player from leaderboard")
end
end)