Home / Server

server.run()

server.run(command)

Enqueues a server console command.

Parameters

NameTypeDescription
commandstringThe command to run as the console.

Returns

Nothing.

Example

command('saveall', { op = true }, function(sender)
  server.run("save-all")
  sender:send("Forced a global save.")
  return true
end)

Notes

Use trusted, fixed command strings. Do not concatenate raw player input to avoid security vulnerabilities.