This is the script to my name tag inserter.
The issue starts to happen once the server has been up for a while.
local Device = {
["Computer"] = "💻",
["Phone"] = "📱",
["Console"] = "🎮"
}
local Players = game:GetService("Players")
local Run = game:GetService("RunService")
local Admin = require(game.ReplicatedStorage.AdminWhitelist)
local function GetStatusText(status,badges)
if status.Value == true then
return {"",Color3.fromRGB(255, 255, 255)}
elseif status.Value == false and badges.Value ~= 0 then
return {"(counting)",Color3.fromRGB(255, 255, 255)}
else
return {"(starting to count...)",Color3.fromRGB(255, 238, 0)}
end
end
local function getDevice(player)
if player:GetAttribute("Device") ~= nil then
return player:GetAttribute("Device")
end
local device = game.ReplicatedStorage.Events.GetDevice:InvokeClient(player)
player:SetAttribute("Device",device)
return device
end
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(model)
local head = model:WaitForChild("Head")
local humanoid = model:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.NameDisplayDistance = 0
end
if head then
local title = script:FindFirstChild("Title"):Clone()
title.Parent = head
title.Username.Text = player.DisplayName
local tabbedout
local tabbed
tabbed = game.ReplicatedStorage.Events.Tabbed.OnServerEvent:Connect(function(Player)
if Player == player then
title.Username.Text = Device[getDevice(player)]..player.DisplayName
title.Username.TextColor3 = Color3.fromRGB(255, 255, 255)
if table.find(Admin,player.UserId) then
title.Username.Text = "[DEVELOPER] "..Device[getDevice(player)]..player.DisplayName
title.Username.TextColor3 = Color3.fromRGB(0, 221, 255)
end
end
if not player and tabbed then
tabbed:Disconnect()
end
end)
tabbedout = game.ReplicatedStorage.Events.TabbedOut.OnServerEvent:Connect(function(Player)
if Player == player then
title.Username.Text = Device[getDevice(player)]..player.DisplayName.. " [AFK]"
title.Username.TextColor3 = Color3.fromRGB(120, 120, 120)
if table.find(Admin,player.UserId) then
title.Username.Text = "[DEVELOPER] "..Device[getDevice(player)]..player.DisplayName.. " [AFK]"
title.Username.TextColor3 = Color3.fromRGB(0, 117, 130)
end
end
if not player and tabbedout then
tabbedout:Disconnect()
end
end)
local badges = player:WaitForChild("leaderstats"):WaitForChild("badges")
if badges then
title.Badges.Text = badges.Value.. " badges"
badges:GetPropertyChangedSignal("Value"):Connect(function()
title.Badges.Text = badges.Value.. " badges"
end)
end
local status = player:WaitForChild("Statistics"):WaitForChild("FinishedCounting")
if status then
badges:GetPropertyChangedSignal("Value"):Connect(function()
local textProperties = GetStatusText(status,badges)
title.Status.Text = textProperties[1]
title.Status.TextColor3 = textProperties[2]
end)
local textProperties = GetStatusText(status,badges)
title.Status.Text = textProperties[1]
title.Status.TextColor3 = textProperties[2]
end
end
end)
end)
Activity level :
Here are some of the Name Tag activity levels that have been going on. If anyone can find a solution that would help a lot.
