• Derma problem.
    3 replies, posted
includes\util.lua:127: attempt to index local 'self' (a number value) And the script: [lua] local PANEL = {} AccessorFunc( PANEL, "RectColor", "RectColor" ) AccessorFunc( PANEL, "BoxColor", "BoxColor" ) AccessorFunc( PANEL, "Count", "Count", FORCE_NUMBER ) AccessorFunc( PANEL, "X", "Rx", FORCE_NUMBER ) AccessorFunc( PANEL, "Y", "Ry", FORCE_NUMBER ) function PANEL:Init() self:SetRectColor(Color(255,0,0,255)) self:SetBoxColor(Color(0,255,0,255)) self:SetCount(100) local _x,_y self._x,self._y = self:GetPos() self:SetRx(self._x) self:SetRy(self._y) local Parenting = self while Parenting:GetParent() != nil and Parenting:GetParent():GetPos() != nil do _x,_y = Parenting:GetParent():GetPos() self:SetRx(_x + self:GetRx()) self:SetRy(_x + self:GetRy()) Parenting = Parenting:GetParent() end end function PANEL:Paint() draw.RoundedBox(6,0,0,self:GetWide(),self:GetTall(),self:GetBoxColor()) surface.SetDrawColor( self:GetRectColor().r, self:GetRectColor().g, self:GetRectColor().b, self:GetRectColor().a ) surface.DrawRect( 0, 0, self:GetWide()*self:GetCount()/100, self:GetTall()) return true end function PANEL:Think() local mx, my = gui.MousePos() end function PANEL:OnMouseIn() end function PANEL:OnMouseOut() end vgui.Register( "DEzekProgressBar", PANEL ); [/lua] I can't find the bug. I'm sure someone in this fantastic forum :) will help me.
The problem is not in that script. You're calling either SetCount, SetRx or SetRy with '.' instead of ':'.
Try deriving from "Panel" in the third argument of vgui.Reg [editline]02:26PM[/editline] Actually my best bet is you are doing something wrong in lines 14 to 17.
BUMP FOR BLACK LIVES MATTER [highlight](User was permabanned for this post ("Spammer" - Kiwi))[/highlight]
Sorry, you need to Log In to post a reply to this thread.