Hovering Names

So I want to make a lua “cheat” I guess. I just want it to make the name of the player hover over there head and I can see it anywhere I am on the map, that is all! So I was wondering how I could start out?

[lua]function playernames()
local ply = LocalPlayer()
for id, targer in pairs(ents.FindByClass(“Player”))[/lua]

something like that?

[lua]
hook.Add(“HUDPaint”, “names_above_heads”, function()
for k, ply in pairs(player.GetAll()) do
if ply ~= LocalPlayer() then
local pos = ply:GetShootPos():ToScreen()
draw.SimpleText(ply:Nick(), “ScoreboardText”, pos.x, pos.y - 20, team.GetColor(ply:Team()), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
end
end
end)
[/lua]

Is that tested? Or should I test. Also, will this work with NPC’s?

It’s tested. Only works with players and bots.

Ok cool! Thanks a lot!