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 e=function(e,C)local N=(e.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 L=N:WaitForChild("\085\115\101\114\110\097\109\101")if C then L.Text="\065\070\075 \124 "..(e.Name..(" \040\064"..(e.DisplayName.."\041")))else L.Text=e.Name..(" \040\064"..(e.DisplayName.."\041"))end end AFKEvent.OnServerEvent:Connect(function(C,N)AFKStatus[C]=N e(C,N)end)
--[ FUNCTIONS ]--

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)
