Derma button

Hello! Just wanted quick help with this button function…


Clicker.DoClick = function()
	    Clicker:SetConsoleCommand("say", "/cp")
		hello:Close()
	end

which only close the panel and not set the command…
I want so it sets up the command and close the panel.

You want it to run the command when you click the button, correct?
Change Clicker:SetConsoleCommand to just RunConsoleCommand( “say”, “/cp” )

[ERROR] addons/npc_police/lua/entities/npc_police/cl_init.lua:71: attempt to call method ‘RunConsoleCommand’ (a nil value)

doesnt work

[editline]26th October 2014[/editline]

I i press the button it will just run the close panel, if i change the function to


Clicker.DoClick = function()
            hello:Close()
	    Clicker:SetConsoleCommand("say", "/cp")
	end

it will run the comman but not close the panel.

I need so it do both.

You don’t have Clicker:RunConsoleCommand right?
It should just be RunConsoleCommand.

Thanks man :slight_smile: You best :wink: