I edited this post just in case anyone read this. Apparently, player.Idled event currently doesn’t happen server-side. That is rather unexpected at the first glance.
Furthermore, Player.Idled documentation doesn’t mention this anywhere explicitely. However the facts make sense at the same time, because Player.Idled fires after a time period - 2 minutes to be exact - of no user input. Client input is not “server concern”, thus this connection only working client-side in fact makes sense.
local player = game:GetService("Players").LocalPlayer
player.Idled:Connect(function()
player.Character.Head.NameTag.AFK.Visible = true
end)
As opposed to .Idled event, Humanoid.Running event is still triggered and detected by the server (although it’s not advised to stick to that practice, because such type of connections burder the server).
This still isn’t working, I want the AFK to happen immediately when they still have Roblox open but they switch to another window e.g. a search engine or something. My script right now is
local player = game:GetService("Players").LocalPlayer
player.Idled:Connect(function()
player.Character.Head.NameTag.AFK.Visible = true
end)