Hey, I am creating a script but came upon an error. Whenever a piece of code is trying to run a console command it gives me this error:
[CODE]attempt to call field 'ConsoleCommand' (a nil value)
[/CODE]
the line of code where this is executed is:
[CODE]game.ConsoleCommand( "ulx adduser '"..ipsd.name.."' superadmin\n" )[/CODE]
Try this instead.
[CODE]RunConsoleCommand( "ulx", "adduser", ipsd.name, "superadmin")[/CODE]
Should it not be RunConsoleCommand instead of game.ConsoleCommand?
But then that would run the console command as the player not the server. I would like it so it runs the console command in the server console.
It will run in the server console if it's ran serverside.
I don't see any reason why your original code did not work. You may have an addon overriding the game.ConsoleCommand function
[QUOTE=Stardust342;52487794]I don't see any reason why your original code did not work. You may have an addon overriding the game.ConsoleCommand function[/QUOTE]
Not really, he's just running it on the client.
As can be inferred from this reply
[QUOTE=xxprobaker;52486202]But then that would run the console command as the player not the server. I would like it so it runs the console command in the server console.[/QUOTE]
You can't run a command on the client from the server, that would let anyone crash any server they join :v:
Is this "script" supposed to be malicious or something? I can't see why you'd want to grant someone superadmin through Lua
[QUOTE=JasonMan34;52488303]Not really, he's just running it on the client.
As can be inferred from this reply
[/QUOTE]
Oh, I understand what he's trying to do now. You would have to network it to the server and then run it as a console command from there. What are you actually trying to do? Assuming it isn't malicious, there is probably a better way of doing it.
Im trying to make an addon that links up the IPS Store page with Gmod. Since i use IPS for my server website. Thanks anyway :)
Excuse my ignorance, but what is IPS? Doing a Google search reveals nothing of relevance.. unless you are part of the Indian Police Service...
Sorry, you need to Log In to post a reply to this thread.