Show text when Player can interact with things

Hello, I have a question, how to make like in this picture, but like with everything “Opening doors” and same things ? If it possible please give me code example.

I’ll tell you what you can use for it

Eyetrace. Detect if it’s a certain entity and then name the function that it can do, aka bed = sleep. Then just paint that to your screen and there you go.

local pos = sumvector:ToScreen()
and then you use pos.x, pos.y to draw shit.

Both guys above are correct, code example:

[lua]hook.Add(“HUDPaint”, “no really, I’m gay”, function()
if not IsValid(LocalPlayer()) then return end

local hitEntity = LocalPlayer():GetEyeTrace().Entity
if not IsValid(hitEntity) then return end

local x, y = hitEntity:GetPos():ToScreen()
draw.WordBox(8, x, y, "kiss me", "Default", Color(50,50,75,100), Color(255,255,255,255))

end)[/lua]

Thanks :slight_smile: