how would I make text appear above a player?

how would I do this? I was thinking of checking if the player’s eye trace was on a player then making the text appear above them, problem is, I don’t know how to do the whole text part. how would I do this?


That would allow you to put 2d text onto the hud. A much cooler way of doing this is using 3D2D.

The wiki has a good example of how to put text (in that case the players name) above a player. You could modify the example on the wiki page to your liking.


[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(), “AdminFont”, pos.x, pos.y - 20, team.GetColor(ply:Team()), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)

That will put the players name above their head.