I'm trying to create something in a game called Garry's Mod that uses Lua for addons.
Basically I need to check if the player's cursor has entered a specific area.
if _hitentity:GetClass() == "treasury" then
draw.RoundedBox(0, 0, 0, 60, 20, Color(255,255,255,255))
if _hitpos == Vector(self:LocalToWorld(Vector(33, -6, 30)), self:LocalToWorldAngles(Angle(0,90,90))) then
draw.RoundedBox(0, 0, 60, 20, 20, Color(0,0,0,255))
end
end
So I've basically got that, I check where the player's hitpos
is (where he's looking) and hitentity
(the entity he's looking at) and I need to check if he's looking at draw.RoundedBox
.
Problem I'm having is I don't know how I could check if the cursor is inside a graphical box that is displayed on an entity.
This is the white box I need to check if the players hitpos has entered