• Lua help Please?
    1 replies, posted
I need some help with this code. i keep getting this error here. "ocrp\gamemode\vgui\item.lua:101] attempt to call method 'RemoveItem' (a nil value)" Heres the whole function line for it. [CODE]function PANEL:PaintOver ( ) if !self:IsVisible() or self:GetAlpha() == 0 then return false; end if self.Type == TYPE_SHOP_LOCAL and GAMEMODE.ItemDatabase[self.MonitorItem].RestrictSelling then surface.SetDrawColor(255, 0, 0, 10); surface.DrawRect(0, 0, self:GetWide(), self:GetTall()); end local IsTrade = self.Type == TYPE_TRADE_INVENTORY or self.Type == TYPE_TRADE_OFFER_LOCAL or self.Type == TYPE_TRADE_OFFER; if self.Type != TYPE_SHOP and !IsTrade then local Quantity = LocalPlayer():GetTable().RoleplayData.Items[self.MonitorItem] or 0; if Quantity == 0 then if self.Type == TYPE_LOCAL then GAMEMODE.InventoryPanel_ItemList:RemoveItem(self); GAMEMODE.InventoryPanel_ItemList:InvalidateLayout(); else GAMEMODE.InventoryPanel_ShopItemList:RemoveItem(self); GAMEMODE.InventoryPanel_ShopItemList:InvalidateLayout(); end end [/CODE] If you can help please do so.
Im gonna take a long shot at this but RemoveItem may not exist.
Sorry, you need to Log In to post a reply to this thread.