How do i make a console command with parameters?
Example:
[CODE]
init.lua
function Test(ply, num)
ply:SetHealth(num)
end
concommand.Add("test" , Test)
cl_init.lua
#####WHEN BUTTON IS PRESSED########
RunConsoleCommand("test")
[/CODE]
Now.. How do i add something to the console command, so i can set the health through a vgui?
For your second question its simply:
[LUA]
button.DoClick = function()
RunConsoleCommand("test")
[/LUA]
I'm not very experienced with Lua, so I cannot answer the first question, hope this helps anyway.