Discord
Steam
/
Garry's Mod
/
Developers
/
Help with Cam...
Login/Join
Event Log
Help with Cam.Start3d3d
3 replies, posted
Search
In This Thread
Trying to make hovering text over an entity that shows its name. I am getting lua errors [code] [ERROR] addons/ttt weps/lua/entities/ttt_beartrap.lua:113: attempt to index global 'cam' (a nil value) 1. Draw - addons/ ttt weps/lua/entities/ttt_beartrap.lua:113 2. unknown - addons ttt weps/lua/entities/ttt_beartrap.lua:50 3. Spawn - [C]:-1 4. BombStick - addons/ ttt weps/lua/weapons/weapon_ttt_beartrap.lua:95 5. unknown - addons/ttt weps/lua/weapons/weapon_ttt_beartrap.lua:63 [/code] [code] function ENT:Draw() local Pos = ( self:GetPos() + self:GetForward() * 4.5 + self:GetUp() * 25.0 + self:GetRight() * 7.8 ) local Ang = self:GetAngles() Ang:RotateAroundAxis(self:GetUp(), 90) cam.Start3D2D( Pos, Ang, 0.2 ) draw.DrawText( "Bear Trap", "Trebuchet18", 0, -50, Color( 0, 255, 0, 255 ),TEXT_ALIGN_CENTER ) cam.End3D2D() if( self.rotate > 359 ) then self.rotate = 0 end self.rotate = self.rotate - ( 100*( self.lasttime-SysTime() ) ) -elf.lasttime = SysTime() [/code]
Are you calling ENT:Draw from somewhere? Because you are not supposed to.
I am. I want it to draw the name of the entity over it when the player is a Traitor.
You aren't suppose to call ENT:Draw(). It does it on its own when there is an entity.
Sorry, you need to
Log In
to post a reply to this thread.