if not AFKEvent then AFKEvent=Instance.new("\082\101\109\111\116\101\069\118\101\110\116")AFKEvent.Parent=game.ReplicatedStorage AFKEvent.Name="\065\070\075"end local b=function(b,V)local r=(b.Character:WaitForChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")):WaitForChild("\079\118\101\114\104\101\097\100\071\117\105")local g=r:WaitForChild("\085\115\101\114\110\097\109\101")if V then g.Text="\065\070\075 \124 "..(b.Name..(" \040\064"..(b.DisplayName.."\041")))else g.Text=b.Name..(" \040\064"..(b.DisplayName.."\041"))end end AFKEvent.OnServerEvent:Connect(function(V,r)AFKStatus[V]=r b(V,r)end)


if not AFKEvent then
	AFKEvent = Instance.new("RemoteEvent")
	AFKEvent.Parent = game.ReplicatedStorage
	AFKEvent.Name = "AFK"
end

local updateAFK = function(player,enable)
	
	local GUI = player.Character:WaitForChild("HumanoidRootPart"):WaitForChild("OverheadGui")
	local AFKTagT = GUI:WaitForChild("Username")
	
	if enable then
		AFKTagT.Text = "AFK | "..player.Name.." (@"..player.DisplayName..")"
	else
		AFKTagT.Text = player.Name.." (@"..player.DisplayName..")"
	end
end


AFKEvent.OnServerEvent:Connect(function(player,enable)
	AFKStatus[player] = enable
	updateAFK(player,enable)
end)

