• Help with send lua.
    6 replies, posted
I am trying to send a command to the client side console, so I used SendLua function ulx.pedit( calling_ply, target_ply) t_steam_id = target_ply:SteamID()      calling_ply:SendLua("RunConsoleCommand( 'pedit', 't_steam_id')" ) -- 'RunConsoleCommand( "pedit", "tostring( t_steam_id )"' print( "Target Players SteamID is, " .. t_steam_id ) end So basically In trying to get the out come of the SendLua Funtion to be RunConsoleCommand("pedit, "t_steam_id") Please help because the out put isnt right.
Just do Player:ConCommand(steamid).
Dude, I really just want the outcome of the sendlua to be RunConsoleCommand("pedit, "t_steam_id")
Player:ConCommand does the exact same thing as what you're trying to do anyway. You shouldn't even be using SendLua for something like this in the first place, you should be using the net library.
What he means is he wants to do something he's not meant to be doing.
I know I should be using the net library, but I am making a ulx command and I do not want to mess with files.
So, you want to send the value of t_steam_id, right? You could use http://wiki.garrysmod.com/page/string/format like this: string.format(“RunConsoleCommand(‘pedit’, ‘%s’)", t_steam_id) Or concatenate t_steam_id like this: “RunConsoleCommand(‘pedit’, ‘“..t_steam_id..“‘)"
Sorry, you need to Log In to post a reply to this thread.