Sending argumets via ConCommand

I have failed miserably in creating arguments that are being sent to the server from the client and vice versa.
So I need an example how to send some args through ConCommand or RunConsoleCommand or some other way.

an explanation or example would really help.

First of all, you’ll need to know that RunConsoleCommand( cmd, args ) ( handles arguments a bit differently to Player:ConCommand( cmd ) (

Unlike Player:ConCommand, with RunConsoleCommand you must pass each argument as a new string, not separating them with a space. For example:

RunConsoleCommand( "developer", "1" )

Compared to how you would do it with Player:ConCommand:

Player:ConCommand( "developer 1" )

I hope that helps. :slight_smile:

I’d recommend using net messages to communicate with the server and to receive responses. Here’s an example:

[lua]//examples of args being sent to/from server

//server to client via sendlua

local args = “you are gay”
for k, v in pairs(player.GetAll()) do
v:SendLua([[RunConsoleCommand(“say”, ]] args [[)]])

// client to server via networking

net.Receive(“a”, function(len, ply)
local str = net.ReadString()

hope this might help somewhat