• Error on using CloseDermaMenus()
    4 replies, posted
Hello, I'm trying to make a custom close button for a DFrame hud menu but when I hit close this error is thrown: [ERROR] lua/derma/derma_menus.lua:37: attempt to call method 'GetDeleteSelf' (a nil value) 1. CloseDermaMenus - lua/derma/derma_menus.lua:37 2. DoClick - addons/darkrpmodification/lua/darkrp_modules/hudreplacement/cl_hudreplacement.lua:63 3. unknown - lua/vgui/dlabel.lua:206 [CODE]local initclose = vgui.Create( "DButton", speed ) initclose:SetPos( 40, 40 ) initclose:SetText( "X" ) initclose:SetSize( 20, 20 ) initclose.DoClick = function() isOpen = false RegisterDermaMenuForClose( speed ) CloseDermaMenus( )[/CODE] Can anyone tell me where I'm going wrong? Thanks.
[ERROR] lua/derma/derma_menus.lua:37: attempt to call method 'GetDeleteSelf' (a nil value) This is what you want to look at, the error is happening on line 37. It's attempting to call a method but it can't because the object trying to call the method is nil so what ever "this:GetDeleteSelf" this is in your case is nil, So figure out why it is. The code you've supplied isn't the offender itself however leads to the problem.
Odd, so it's an actual problem with Garry's Mod's derma classes?
You could always do speed:Remove(), I think?
That sounds much simpler than my method, I'll give it a try in the morning.
Sorry, you need to Log In to post a reply to this thread.