I have made an sENT in lua and have made wire inputs and outputs in the init.lua file. In cl_init.lua I have a derma panel that pops up when you call a custom function (specifically the code activator:SendLua( "loadKeyboard()" ) in the ENT:Use() function in init.lua) and when you press a button it sets one of those outputs to a value. This is the code I have so far inside of my function for that button:
[code]DButton1 = vgui.Create('DButton', DFrame1)
DButton1:SetSize(40, 40)
DButton1:SetPos(40, 55)
DButton1:SetText('1')
DButton1.DoClick = function()
Wire_TriggerOutput(self.Entity, "Output 1", 49)
end[/code]
The error I am having is that when I click on the button it yells at me for "calling 'self', a nil value". How would I be able to fix this error?
UPDATE: Just figured it out. Added console commands to init.lua, and also created a variable set to 'self' and used that variable in the wire command which is called by the console command I added earlier.
Sorry, you need to Log In to post a reply to this thread.