> ## Documentation Index
> Fetch the complete documentation index at: https://docs.selvut.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Module Command

> A script module with settings and a command.

Save as `greeter.lua`.

```lua theme={null}
Script.meta({
  name = "Greeter",
  description = "Adds a local greeting command."
})

local prefix = Setting.text("Prefix", {
  default = "Hello",
  description = "Text placed before the name."
})

local announce = Setting.bool("Announce Enable", {
  default = true,
  description = "Print a message when the script is enabled."
})

Script.command("greet", {
  description = "Print a local greeting",
  usage = "greet <name>",
  parameters = {
    { name = "name", type = "string", required = false, default = "there" }
  }
}, function(args, name)
  Chat.log(prefix.get() .. " " .. name)
end)

Script.on("enable", function()
  if announce.get() then
    Chat.log("Greeter enabled")
  end
end)
```

Run it with:

```txt theme={null}
;greet Selvut
```
