Hey guys,
So i created a function inside my custom entity wich is ENT:DrawScreen() and there is a variable inside the entity lua wich is tdui and if i call for that variable inside for example ENT:Draw() it will return the value defined for that variable. However in ENT:DrawScreen() it always returns nil. Here's the code:
tdui = include("tdui.lua")
function ENT:DrawScreen()
if(self.draw) then
self.Panel = self.Panel or tdui.Create() -- tdui returns nil
local offsetx = -640;
local offsety = -935.5;
self.Panel:Rect(offsetx, offsety, 1280, 720, Color(33,33,33), Color(33, 33, 33))
self.Panel:Cursor()
self.Panel:SetIgnoreZ(false)
self.Panel:Render(self:GetPos() + self:GetAngles():Forward() * -1.7, self:GetAngles(), 0.0222)
end
end
Could any of you please help me?
your function never returns anything
I dont mean tdui as a return of the function, but when the function is using it it returns nil. When i am calling tdui inside the function its value is nil for some reason
Anyone please help?
Sorry, you need to Log In to post a reply to this thread.